Brandenburg having changed sides, the Swedes were expelled from Poland; and Frederick III of Denmark, despite the advice of De Witt, seized the opportunity to declare war on Sweden. Although it was the depth of winter Charles Gustavus lost no time in attacking Denmark. He quickly drove the Danes from Schonen and Funen and invaded Seeland. Frederick was compelled at Roeskilde (February, 1658) to accept the terms of the conqueror. Denmark became virtually a Swedish dependency, and undertook to close the Sound to all foreign ships. Involved as the republic was in disputes at this time with both France and England, and engaged in war with Portugal, De Witt would have been content to maintain a watchful attitude in regard to Scandinavian matters and to strive by diplomacy to secure from Sweden a recognition of Dutch rights. But his hand was forced by Van Beuningen, who went so far as to urge the Danish king to rely on his defensive alliance with the republic and to break the treaty of Roeskilde. Charles Gustavus promptly invaded Denmark, drove the Danish fleet from the sea, placed strong garrisons at Elsinore and Kronborg, and laid siege to Copenhagen. Van Beuningen had proudly asserted that “the oaken keys of the Sound lay in the docks of Amsterdam,” and his boast was no empty one. At the beginning of October a force of thirty-five vessels under Obdam carrying 4000 troops sailed for the Sound with orders to destroy the Swedish fleet, and to raise the siege of Copenhagen. On November 8 Obdam encountered the Swedes in the entrance to the Baltic. The Swedish admiral Wrangel had forty-five ships under his command, and the battle was obstinate and bloody. Obdam carried out his instructions. Only a remnant of the Swedish fleet found refuge in the harbour of Landskrona, but the Dutch also suffered severely. The two vice-admirals, Witte de With and Floriszoon, were killed, and Obdam himself narrowly escaped capture, but Copenhagen was freed from naval blockade.