Strambi was exiled from his diocese 1808 after he refused to take an oath of allegiance to the First French Empire under Napoleon who had annexed Macerata as part of his empire. He spent that time in Novara and Milan before he managed to return to his see in a triumphant return in 1814. He served as bishop for the remainder of the pontificate of Pope Pius VII before his successor Pope Leo XII accepted Strambi's resignation and summoned him to Rome as his advisor. But the sudden illness of the pope - which seemed to prove fatal - prompted Strambi to offer his own life to God so that the pope could live. Leo XII rallied to great surprise but Strambi died of a stroke within the week.