In July 1864, Charles I succeeded his father William as king and almost at once had to face considerable difficulties. In the competition between Austria and Prussia for supremacy in Germany, William had consistently taken the Austrian side and the new king continued this policy. In 1866, Württemberg took up arms on behalf of Austria in the Austro-Prussian War, but three weeks after the Battle of Königgrätz (3 July 1866), the allies suffered a comprehensive defeat at the Battle of Tauberbischofsheim. The Prussians occupied northern Württemberg and negotiated a peace in August 1866. Württemberg paid an indemnity of 8,000,000 gulden, and concluded a secret offensive and defensive treaty with its conqueror. Württemberg was a party to the 1864 Geneva Convention and the St Petersburg Declaration of 1868.