House of Bernadotte
In 1814, Denmark–Norway was on the losing side in the Napoleonic wars. Under the Treaty of Kiel, negotiated on 14 January 1814, Norway was ceded to the king of Sweden, of the new House of Bernadotte. In an attempt to take control of their destiny, the Norwegians convened a constitutional assembly at Eidsvoll and, on 17 May 1814, signed the Constitution of Norway. The viceroy and heir to the thrones of Denmark and Norway, Prince Christian Frederik, was elected by the assembly as king.