He was made a priest on 29 May 1763 and on 11 September 1775 titular bishop of Tyana. On 20 September 1775 he became nuncio to Cologne. Before taking up the post, he was ordained a bishop on 24 September 1775 by pope Pius VI.
On 14 February 1785 the pope appointed him cardinal in pectore and on 7 May the same year nuncio to Portugal. On 21 February 1794 he was publicly appointed a cardinal and on 22 September 1795 bishop of Cesena, where he held the personal title of prince bishop. On 18 December 1795 he was made cardinal priest of the titular church of Santa Maria della Pace. On 18 September 1807 he opted for the titular church of Santa Prassede.