After Denmark–Norway was attacked by the United Kingdom at the 1807 Battle of Copenhagen, it entered into an alliance with Napoleon, with the war leading to dire conditions and mass starvation in 1812. As the Danish kingdom found itself on the losing side in 1814, it was forced, under terms of the Treaty of Kiel, to cede Norway to the king of Sweden, while the old Norwegian provinces of Iceland, Greenland, and the Faroe Islands remained with the Danish crown. Norway took this opportunity to declare independence, adopted a constitution based on American and French models, and elected the Crown Prince of Denmark and Norway, Christian Frederick, as king on 17 May 1814. This is the famous Syttende mai (Seventeenth of May) holiday celebrated by Norwegians and Norwegian-Americans alike. ''Syttende mai'' is also called ''Norwegian Constitution Day''.