They were built to defend Gothenburg which was Sweden's only direct access to the North Sea and Atlantic Ocean.
[1] Gothenburg was founded in 1621 at the direction of King Gustav II Adolf.
[2] When military engineer Erik Dahlberg (1625–1703) took responsibility for Sweden's fortifications in 1676 he implemented the wishes of King Karl XI for modern bastions of high wall construction.
The ramparts were lined with walls of blasted rock and the fortified town of Gothenburg developed with 13 polygonal bastions and accompanying moat, ravelins and 3 city gates (Kungsporten; Nya porten, later renamed Drottningporten; and Karlsporten/Hållgårdsporten).
[3] Gothenburg was growing rapidly by the end of the 1700s while the fortifications had suffered from poor maintenance.