section_path: History/Early modern history (1536–1849)
section_name: Early modern history (1536–1849)
paragraph_text: Early modern history (1536–1849)
  
  After Sweden permanently broke away from the personal union, Denmark tried on several occasions to reassert control over its neighbour. King Christian IV attacked Sweden in the 1611–1613 Kalmar War but failed to accomplish his main objective of forcing it to return to the union. The war led to no territorial changes, but Sweden was forced to pay a war indemnity of 1 million silver riksdaler to Denmark, an amount known as the Älvsborg ransom. King Christian used this money to found several towns and fortresses, most notably Glückstadt (founded as a rival to Hamburg) and Christiania. Inspired by the Dutch East India Company, he founded a similar Danish company and planned to claim Ceylon as a colony, but the company only managed to acquire Tranquebar on India's Coromandel Coast. Denmark's large colonial aspirations included a few key trading posts in Africa and India. While Denmark's trading posts in India were of little note, it played an important role in the highly lucrative Atlantic slave trade, through its trading outposts in Fort Christiansborg in Osu, Ghana through which 1.5 million slaves were traded. While the Danish colonial empire was sustained by trade with other major powers, and plantations – ultimately a lack of resources led to its stagnation.
  
  In the Thirty Years' War, Christian tried to become the leader of the Lutheran states in Germany but suffered a crushing defeat at the Battle of Lutter. The result was that the Catholic army under Albrecht von Wallenstein was able to invade, occupy, and pillage Jutland, forcing Denmark to withdraw from the war. Denmark managed to avoid territorial concessions, but King Gustavus Adolphus ' intervention in Germany was seen as a sign that the military power of Sweden was on the rise while Denmark's influence in the region was declining. Swedish armies invaded Jutland in 1643 and claimed Scania in 1644. In the 1645 Treaty of Brømsebro, Denmark surrendered Halland, Gotland, the last parts of Danish Estonia, and several provinces in Norway.
  
  Seeing an opportunity to tear up the Treaty of Brømsebro, King Frederick III of Denmark, in 1657, declared war on Sweden, the latter being deeply involved in the Second Northern War (1655–1660), and marched on Bremen-Verden. This led to a massive Danish defeat as the armies of King Charles X Gustav of Sweden conquered Jutland and, following the Swedish March across the frozen Danish straits, occupied Funen and much of Zealand before signing the Peace of Roskilde in February 1658, which gave Sweden control of Scania, Blekinge, Bohuslän, Trøndelag, and the island of Bornholm. Charles X Gustav quickly regretted not having ruined Denmark and in August 1658, he launched a second attack on Denmark, conquered most of the Danish islands, and began a two-year-long siege of Copenhagen. King Frederick III actively led the defence of the city, rallying its citizens to take up arms, and repelled the Swedish attacks. The siege ended following the death of Charles X Gustav in 1660. In the ensuing peace settlement, Denmark managed to maintain its independence and regain control of Trøndelag and Bornholm. Attaining great popularity following the war, Frederick III used this to disband the elective monarchy in favour of absolute monarchy, which lasted until 1848 in Denmark.
  
  Denmark tried but failed to regain control of Scania in the Scanian War (1675–1679). After the Great Northern War (1700–21), Denmark managed to regain control of the parts of Schleswig and Holstein ruled by the house of Holstein-Gottorp in the 1720 Treaty of Frederiksborg and the 1773 Treaty of Tsarskoye Selo, respectively. Denmark prospered greatly in the last decades of the 18th century due to its neutral status allowing it to trade with both sides in the many contemporary wars. In the Napoleonic Wars, Denmark traded with both France and the United Kingdom and joined the League of Armed Neutrality with Russia, Sweden, and Prussia. British fears that Denmark-Norway would ally with France led to two attacks against Danish targets in Copenhagen in 1801 and 1807. These attacks resulted in the British capturing most of the Dano-Norwegian navy and led to the outbreak of the Gunboat War. In 1807 much of Copenhagen was burned down as a result of these bombardments, including Vor Frue Kirke, the main Danish cathedral. British control of the waterways between Denmark and Norway proved disastrous to the union's economy and in 1813 Denmark–Norway went bankrupt.
  
  The union was dissolved by the Treaty of Kiel in 1814; the Danish monarchy "irrevocably and forever" renounced claims to the Kingdom of Norway in favour of the Swedish king. Denmark kept the possessions of Iceland (which retained the Danish monarchy until 1944), the Faroe Islands and Greenland, all of which had been governed by Norway for centuries. Apart from the Nordic colonies, Denmark continued to rule over Danish India from 1620 to 1869, the Danish Gold Coast (Ghana) from 1658 to 1850, and the Danish West Indies from 1671 to 1917.