Soon after the Erkelenz was elevated to a town status in the 12th century, work began on the brick fortifications of the place. These probably consisted of basic ramparts as had been common since time immemorial for the defence of settlements. Although the castle was not documented until 1349, the town appeared to have developed under the protection of the castle.
The castle has 23 high keep, curtain walls and corner towers. It was part of larger city walls. It was badly damaged by French army in 1674.
First record of Kastelholma (or Kastelholm) castle is from the year 1388 in the contract of Queen Margaret I of Denmark, where a large portion of the inheritance of Bo Jonsson Grip was given to the queen. The heyday of the castle was in the 15th and 16th centuries when it was administrated by Danish and Swedish kings and stewards of the realms. Kastelhoma was expanded and enhanced several times.
In the end of 16th century castle was owned by the previous queen Catherine Jagellon (Stenbock), an enemy of the King of Sweden Eric XIV. King Eric conquered Kastelholma in 1599 and all defending officers were taken to Turku and executed. The castle was damaged under the siege and it took 30 years to renovate it.
In 1634 Åland was joined with the County of Åbo and Björneborg and Kastelholma lost its administrative status.