His father's family was one of merchants of the countryside that became rich and entered the patriciate of Terni and Spoleto; his mother was from the Dukes of Sermoneta, who were eminent members of the Roman aristocracy and descendants of Pope Boniface VIII.
He was a nephew of Michele di Pietro, who served as Cardinal and Latin Patriarch of Jerusalem.
He entered the Seminario Romano where he studied theology and finally the Collegio di Protonotari Apostolici, Rome where he received a doctorate utroque iuris (in both canon and civil law) on 10 May 1829.
Pope Gregory XVI recalled him to Rome and named him Auditor of the Sacred Roman Rota on 6 April 1835.
He was created Cardinal-Priest of San Giovanni a Porta Latina by Pope Pius IX in the consistory of 19 December 1853 and reserved in pectore.
He played an essential role in its organisation and obtained the necessary guarantees from the Italian government not to interfere with the conclave of 1878 when Pius IX died.
Pope Leo appointed him as Camerlengo of the Holy Roman Church on 28 March 1878,[2] and he held the post until his death.