In 1855 he resigned from the post of Minister of War because he went to fight in the Crimean War. He was Prime Minister of the Kingdom of Sardinia from 19 July 1859 to 21 January 1860. In the years immediately after the Italian unification, he was governor of Milan and Prefect of Naples.