Birth and studies
Lambertini was born into a noble family of Bologna, the third of five children of Marcello Lambertini and Lucrezia Bulgarini. At the time of his birth, Bologna was the second largest city in the Papal States. His earliest studies were with tutors, and then he was sent to the Convitto del Porto, staffed by the Somaschi Fathers. At the age of thirteen, he began attending the Collegio Clementino in Rome, where he studied rhetoric, Latin, philosophy, and theology (1689–1692). During his studies as a young man, he often studied the works of St. Thomas Aquinas, who was his favorite author and saint. While he enjoyed studying at Collegio Clementino, his attention turned toward civil and canon law. Soon after, in 1694 at the age of nineteen, he received the degree of Doctor of Sacred Theology and Doctor Utriusque Juris (both ecclesiastical and civil law).
Lambertini became an assistant to Msgr. Alessandro Caprara, the Auditor of the Rota. After the election of Pope Clement XI in November 1700, he was made a consistorial advocate in 1701. Shortly after, he was created a Consultor of the Supreme Sacred Congregation of the Roman and Universal Inquisition, and then in 1708 Promoter of the Faith. As Promoter of the Faith, he achieved two major successes. The first was the canonization of Pope Pius V. The second was the composition of his treatise on the process of the beatification and canonization of saints.
In 1712 Lambertini was named Canon Theologus of the Chapter of the Vatican Basilica and member of the Sacred Congregation of Rites; in 1713 he was named monsignor; and in 1718 secretary of the Sacred Congregation of the Council.
On 12 June 1724, only two weeks after his election, Pope Benedict XIII appointed Lambertini titular bishop of Theodosia. Lambertini was consecrated a bishop in Rome, in the Pauline Chapel of the Vatican Palace, on 16 July 1724, by Pope Benedict XIII. The co-consecrators were Giovanni Francesco Nicolai, titular Archbishop of Myra (Vicar of the Vatican Basilica), and Nicola Maria Lercari, titular Archbishop of Nazianzus (Papal Maestro di Camera). In 1725, he served as the Canonist at the Roman Synod of Pope Benedict XIII.
In 1718, the Istituto delle scienze ed Arti Liberali in Bologna had begun construction of a chapel for everyday convenience dedicated to the Annunication of the Virgin Mary. In 1725, Bishop Prospero Lambertini of Theodosia, who was working in the Roman Curia but was mindful of his origins, ordered the chapel to be painted. He handed over the work to Carlo Salarolo, who had the walls of the chapel adorned. Lambertini also ordered and paid for the painting above the main altar, an image of the Virgin being greeted by the angel, the work of Marcantonio Franceschini.
He was made Bishop of Ancona on 27 January 1727, and was permitted to retain the title of Archbishop, as well as all the offices which he had already been granted. He was also allowed to continue as Abbot Commendatory of the Camaldolese monastery of S. Stefano di Cintorio (Cemeterio) in the diocese of Pisa. In 1731, the new bishop had the main altar and the choir of the cathedral restored and renovated. Once he became pope, Lambertini remembered his former diocese, sending an annual gift to the Church of Ancona, of sacred vessels of gold or silver, altar appointments, vestments, and other items.
Bishop Lambertini was created a Cardinal on 9 December 1726, though the public announcement of his promotion was postponed until 30 April 1728. He was assigned the titular church of Santa Croce in Gerusalemme on 10 May 1728. He participated in the 1730 conclave.
On 30 April 1731 Cardinal Lambertini was appointed Archbishop of Bologna by Pope Clement XII. During his time as archbishop, he composed an extensive treatise in three volumes, De synodo dioecesana, on the subject of the diocesan synod, presenting a synthesis of the history, Canon Law, practices, and procedures for the holding of those important meetings of the clergy of each diocese. He was in fact preparing the ground for the holding of a synod of his own for the diocese of Bologna, an expectation he first announced in a Notificazione of 14 October 1732. When the first edition of the De Synodo was published in 1748, however, the synod still had not taken place. He continued in the office of Archbishop of Bologna even after he became Pope, not finally resigning until 14 January 1754.