Hostilities broke out on 14 June as the Austro-Prussian War (June–August 1866), in which Prussia and the north German states faced not only Austria but much of the rest of Germany, especially the southern states. Three days later Italy declared war on Austria in the Third Italian War of Independence, Italy now being Prussia's ally. Thus Austria had to fight on two fronts. Their first engagement resulted in a minor victory against the Italians at Custoza near Verona on 24 June. However, on the northern front Austria suffered a major military defeat at the Battle of Königgrätz in Bohemia on 3 July. Although Austria had a further victory against the Italians in a naval battle at Lissa on 20 July, it was clear by then that the war was over for Austria, Prussian armies threatening Vienna itself, forcing the evacuation of the court to Budapest. Napoleon III intervened resulting in an armistice at Nikolsburg on 21 July, and a peace treaty in Prague on 23 August. In the meantime the Italians who had had a series of successes throughout July, and signed an armistice at Cormons on 12 August rather than face the remaining Austrian army freed from its northern front.