During the First Schleswig War (1848–1851), the Ritter- und Landschaft prevented a Prussian conquest by requesting Hanoverian troops as peace-keeping occupational forces on behalf of the German Confederation. In 1851 King Frederick VII of Denmark was restored as Duke of Saxe-Lauenburg. Prussian and Austrian forces invaded the duchy during the Second Schleswig War. By the Treaty of Vienna (1864), King Christian IX of Denmark resigned as duke and ceded the duchy to Prussia and Austria. After receiving a £300,000 financial compensation, Austria waived its claim to Saxe-Lauenburg by the Gastein Convention in August 1865. The Ritter- und Landschaft then offered the ducal throne to William I of Prussia. In September the same year, he accepted and ruled the duchy in personal union since. William appointed the then Minister President of Prussia, Otto von Bismarck, as minister for Saxe-Lauenburg. In 1866, Saxe-Lauenburg joined the North German Confederation. However, its vote in the Bundesrat was counted along with those of Prussia.