The separation of Sweden and Finland had consequences outside the two countries. When the Finnish War started, after an attack from Russia in February 1808, Sweden had just started an invasion of Norway, having joined the British side in the Napoleonic Wars against France and its ally Denmark–Norway. This two-front war was largely the reason for the loss against Russia. In 1812 and early 1813, the newly elected Swedish crown prince, the French marshal and former commander under Napoleon, Jean Baptiste Bernadotte held secret negotiations with both Russia, United Kingdom and Prussia, where he offered to join the battle against Napoleon in return for Sweden getting Norway as prize. They agreed, and in 1813 he allied Sweden with Napoleon's enemies of the Sixth Coalition in order to secure this. Charles John, as the Commander-in-Chief of the Northern Army, successfully defended the approaches to Berlin and was victorious in battle against Oudinot in August and against Ney in September at the Battles of Großbeeren and Dennewitz. But after the Battle of Leipzig he went his own way, determined at all hazards to cripple Denmark and to secure Norway, defeating the Danes at Bornhöved in December. His efforts culminated in the Treaty of Kiel, where king Frederick VI of Denmark agreed to cede Norway to Sweden. The Norwegians weren't as keen, though, but after losing the Swedish-Norwegian War of 1814, Norway entered a personal union with Sweden which lasted until 1905, when Norway reached full independence.