Started originally in the 16th century to protect the searoute to Stockholm and modernised many times until the early 19th century.