The Prime minister of the Kingdom of Sardinia Camillo Benso was able to take Napoleon III on his side after the Orsini affair during the Italian Unification: The French army was allied with Victor Emmanuel II of Italy during the Second Italian War of Independence and defeated the Austrians at the Battle of Magenta and the Battle of Solferino. After that, France opposed Italy during the Capture of Rome (but did not do anything to prevent it), that represented the end of the Papal temporal power.