Denmark has a long history dating back to the Viking Age. Key events include the establishment of the Kalmar Union in 1397 and the adoption of an absolute monarchy in 1660. Denmark transitioned to a democratic constitutional monarchy in the 19th century and lost territory in northern Germany after the Second Schleswig War of 1864. Denmark remained neutral during World War I but was occupied by Germany during World War II. Denmark has a social welfare system and highly developed economy. Copenhagen is the capital and largest city.