Akershus Fortress is a medieval castle that was built to protect Oslo, the capital of Norway. It has also been used as a prison.
The fortress has successfully survived all sieges, primarily by Swedish forces, including those by forces led by Charles XII in 1716. In the early 17th century, the fortress was modernized and remodeled under the reign of the active King Christian IV, and got the appearance of a renaissance castle.
The fortress was first used in battle in 1308, when it was besieged by the Swedish duke Eric of Södermanland, whose brother won the Swedish throne in 1309. The siege was eventually broken by a local Norwegian army in a battle. (This battle forms a forms a major part of the plot of Sigrid Undset historical novel "In the Wilderness", the third volume of her tetralogy The Master of Hestviken.)
In 1449-1450 the castle was besieged again, this time by the Swedish king Karl Knutsson Bonde, but he had to lift the siege after a while. The castle wasn’t besieged again until 1502 when Scottish soldiers in service of the Danish king besieged the castle in order to regain it from the hands of the Norwegian nobleman Knut Alysson.