Norway had been in a closer union with Denmark, but Denmark-Norway's alliance with Napoleonic France caused the United Kingdom and Russia to consent to Sweden's annexation of the realm as compensation for the loss of Finland in 1809 and as a reward for joining the alliance against Napoleon. By the 1814 Treaty of Kiel, the King of Denmark-Norway was forced to cede Norway to the King of Sweden, but Norway refused to submit to the treaty provisions, declared independence, and convoked a constituent assembly at Eidsvoll in early 1814.