During the French invasion of Russia in 1812 about 30,000 Bavarian soldiers were killed in action. With the Treaty of Ried of 8 October 1813 Bavaria left the Confederation of the Rhine and agreed to join the Sixth Coalition against Napoleon in exchange for a guarantee of her continued sovereign and independent status. On 14 October, Bavaria made a formal declaration of war against Napoleonic France. The treaty was passionately backed by the Crown Prince Ludwig and by Marshal von Wrede. With the Battle of Leipzig in October 1813 ended the German Campaign with the Coalition nations as the victors, in a complete failure for the French, although they achieved a minor victory when an army of Kingdom of Bavaria attempted to block the retreat of the French Grande Armée at Hanau.