In 1859, France sided with the Kingdom of Sardinia in a war against Austria, the Austro-Sardinian War. Napoleon III did not keep his promises to Cavour to fight until all of the Kingdom of Lombardy-Venetia had been conquered. Following the bloody battles of Magenta and Solferino, both French victories, Napoleon thought the war too costly to continue and made a separate peace behind Cavour's back in which only Lombardy would be ceded.