It was surrendered to Sweden along with the rest of Skåneland as part of the Treaty of Roskilde in 1658. The fortress was retaken by Danish forces in 1676 during the Scanian War, and its capture celebrated by flying a giant Flag of Denmark above it. This flag was later captured by the Swedish army and is preserved in the Army Museum (Armémuseum) in Stockholm.