Charles X. now prepared to meet Brandenburg and Austria, once more siding against Sweden. It was necessary to keep Holland out from the Baltic, and when Charles X. found Denmark unwilling to keep the conditions of the recent treaty on that point, the war-lord became wrathful, dooming obnoxious Denmark to lose her very existence. But the spirit of patriotism, which so often had saved Sweden in instances of extreme danger, now sided with Denmark, as it had already sided with Poland. King Frederic declared he would die like a bird in its own nest, and roused the patriotism of the population of Copenhagen, which, badly defended, was hurriedly fortified at the news of an intended attack. Contrary to the advice of Eric Dahlberg, Charles X. made no instantaneous attack, but commenced a siege, although he did not bring with him the necessary means. The castle of Kronborg by Elsinore was captured and its cannon used against Copenhagen. The greatest enthusiasm prevailed in the Danish capital; the king slept in a tent by the fortifications, and especially the students and Norwegian sailors distinguished themselves by their valor and patriotism. Charles X. found it impossible to take Copenhagen and retired to some distance from the capital. What caused Charles to retire was the arrival of a Dutch fleet. It had been met by the Swedish fleet, under command of Charles Gustavus Wrangel, the hero of Fredericia and Kronborg. After six hours of hard fighting the Dutch forced the entrance to the Sound. Before leaving, the Swedish king resolved to make a desperate effort to capture Copenhagen, defended by 13,000 troops and by a patriotic population, with his 8,000 Swedes. The attack was made in the night of February 11, 1659, but the city, forewarned by traitors, tendered the Swedes a warm reception, consisting of artillery fire, stones, and scalding hot water. The Swedes lost 600 men and suffered their first and only defeat under the command of Charles X.
The situation was grave. The Swedish army in Jutland was forced to retire; the troops of 5,000 men in Funen were defeated and made prisoners; a revolt took place in Bornholm, and the Danes recaptured the district of Drontheim. The powers united in their efforts to force Sweden and Denmark to a treaty of peace on the basis of the Rœskilde stipulations. Charles still held his head high, declaring that he would crush the fleets of the allies if they tried to interfere in the affairs of the North, striking a sharply discordant note in the concert of the powers. To Denmark he was willing to cede the district of Drontheim, but prepared to occupy that of Akkershus instead, when he was taken ill at the convening Riksdag at Gothenburg, dying February 11, 1660, in the palace erected by his friend Lennart Torstensson.