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.