In the early years of the French Revolutionary Wars Duke Frederick Francis I of Mecklenburg-Schwerin had remained neutral, and in 1803 he regained Wismar, which was pawned to him from Sweden. After Napoleon's victory at the Battle of Austerlitz and the final dissolution of the Holy Roman Empire in 1806, he joined the Confederation of the Rhine by a treaty of 22 March 1808. Napoleon, in preparation for the French invasion of Russia in 1812, disregarded this alliance; he offered the duchy to the Swedish heir apparent Jean Bernadotte for his support. Duke Frederick Francis was the first member of the confederation to abandon Napoleon, to whose armies he had sent a contingent, and in the following War of the Sixth Coalition he fought against the troops of the First French Empire —with the result that his new allies, Prussia and Russia, now offered his duchy to the Kingdom of Denmark. Instead, Denmark was promised the adjacent lands of Swedish Pomerania by the 1814 Peace of Kiel and the rule of the Mecklenburg dukes remained inviolate. At the 1815 Congress of Vienna, Frederick Francis joined the newly established German Confederation, and like his Strelitz cousin Charles II, was elevated to the title of a "Grand Duke of Mecklenburg-Schwerin". In 1819 serfdom was finally abolished in his dominions. The Mecklenburg governance was still determined by the 1755 inheritance agreement, which upheld the medieval hierarchy of the estates, which largely affected the social and economic development of both grand duchies. During the revolutions of 1848, the duchy witnessed a considerable agitation in favour of a liberal constitution. On 10 October 1849 Grand Duke Frederick Francis II granted a new Basic law elaborated by his First MinisterLudwig von Lützow. In the subsequent reaction of the Mecklenburg nobility, backed by the Strelitz grand dukeGeorge, all the concessions which had been made to democracy were withdrawn and further restrictive measures were introduced in 1851 and 1852. In the dispute over neighbouring Holstein which culminated in the 1866 Austro-Prussian War, Frederick Francis II supported the Kingdom of Prussia, whom he aided with Mecklenburg-Schwerin soldiers. His grand duchy began to pass more and more under Prussian influence. In 1867 he joined the North German Confederation and the Zollverein. In the Franco-Prussian War, Prussia again received valuable assistance from Grand Duke Frederick Francis II, who was an ardent advocate of German unity and held a high command in her armies. In the course of the German unification in 1871, Mecklenburg-Schwerin and Mecklenburg-Strelitz became states of the German Empire. There was now renewed agitation for a more democratic constitution, and the German Reichstag parliament gave some countenance to this movement. In 1897 Frederick Francis IV succeeded his father Frederick Francis III as the last grand duke of Mecklenburg-Schwerin. In 1907 the Grand Duke promised a constitution to his subjects. The duchy had always been under a feudal system of government, the grand duke having the executive entirely in his hands. The duchy shared a diet, which met for a short session each year. At other times they were represented by a committee consisting of the proprietors of knights' estates, known as the Ritterschaft, and the Landschaft, or burgomasters of certain towns. Mecklenburg-Schwerin returned six members to the Reichstag. Upon the suicide of his cousin Grand Duke Adolphus Frederick VI on 23 February 1918, Frederick Francis served as regent of Mecklenburg-Strelitz. Shortly afterwards, on 14 November, he was forced to renounce the Mecklenburg throne in the course of the German Revolution. The grand duchy turned into the Free State of Mecklenburg-Schwerin, a federated state of the Weimar Republic. Thereby ended nearly eight centuries of continuous rule by the originally Obotrite Mecklenburg dynasty, beginning with their progenitor Prince Niklot. Until 1918 the grand duke was styled as "Prince of the Wends".