Lamberto was of simple rural origins, hailing from Fiagnano in the Casalfiumanese commune, near Imola in present-day Italy. Entering into an ecclesiastical career, he soon became archdeacon of Bologna, where his abilities eventually saw him attract the attention of Pope Urban II, who presumably appointed him cardinal priest of the "Titulus St. Praxedis" in 1099. His successor, Pope Paschal II, made Lamberto a Canon of the Lateran before elevating him to the position of cardinal bishop of Ostia in 1117. Lamberto was one of the cardinals who accompanied Pope Gelasius II into exile in 1118–19 and was at his bedside when Gelasius died.