As a consequence of the tumultuous conflicts of the Napoleonic Wars, Sweden had allied itself with the Russian Empire, United Kingdom and the other parties of the Fourth Coalition against Napoleonic France. However, following the treaty of Treaty of Tilsit in 1807, Russia made peace with France and left the coalition. This enabled Russia in 1808 to challenge Sweden in the Finnish War, over the control of Finland. In the Treaty of Fredrikshamn on 17 September 1809 Sweden was obliged to cede all its territory in Finland, to Russia.