In mid-June 1866 war broke out between Austria and Prussia over the administration of Schleswig and Holstein and the future of the German Confederation. Italy took advantage of the situation by siding with Prussia in the conflict, declaring war on Austria on 20 June. The Italian government hoped that the ongoing Austro-Prussian campaign would allow their armies to flank the Austrian forces, seizing Venice, Friuli, Trentino, and Trieste with little difficulty. Austrian forces defeated the Italian Army at the Battle of Custoza and the Italian Navy at Battle of Lissa; however, in the meantime, Giuseppe Garibaldi's volunteers had advanced in the direction of Trento in the invasion of Trentino, winning the battle of Bezzecca. Later, the Habsburgs were forced to seek an armistice with Italy due to the collapse of their northern armies following the decisive Battle of Sadowa and the rapid Prussian advance into Bohemia and towards Vienna. On 12 August, an armistice was signed by Austria and Italy at Cormons bringing an end to the fighting.