In 1657 Christian IV's successor, Frederik III, declares war on Sweden, the unfortunate outcome being that the Danes lose all land east of the Sound. Copenhagen is no longer at the heart of the realm. Despite a peace agreement, the war continues. In 1659 the Swedes find themselves outside Copenhagen's ramparts after having conquered most of Denmark. The king and the burghers of Copenhagen join forces to defend the city and resist the Swedish attack and the king consolidates his position.
Events take on far-reaching consequences.
The citizens' reward for defending the city so bravely is very modest. Too much liberty and power goes against the grain of the king's sovereign despotism. But a council of 32 citizens is created, which is nevertheless subject to the royally appointed City Fathers, consisting of mayors and aldermen. Administrative buildings are erected to cope with mounting bureaucracy, and the townsmen's life becomes more and more regulated. A corps of nightwatchmen is set up, and the offices of police constable and fire chief are introduced as well as common standards for weights and measures.