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 defense 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.