Through the influence of his family, he was named, by Pope Clement X, Cardinal-Priest of San Sisto on 22 February 1672 (allegedly against his will). He also lectured in philosophy at Brescia. Later he was bishop of Manfredonia, bishop of Cesena and then archbishop of Benevento. After an earthquake in 1688 and another in 1702 he organized relief efforts for the victims. He remained a close friend of a local mystic, Serafina di Dio.