Lejre was the capital of an Iron Age kingdom sometimes referred to as the Lejre Kingdom. According to early legends, this was ruled by kings of the Skjöldung dynasty, predecessors of the kings of medieval Denmark. Legends of the kings of Lejre are known from a number of medieval sources, including the twelfth-century Gesta Danorum written by Saxo Grammaticus and the anonymous twelfth-century Chronicon Lethrense, or Chronicle of Lejre. As the home of the Skjölding dynasty mentioned in Beowulf, Lejre has long been thought to have been the real-world counterpart to Heorot, the fabulous royal hall where the first part of the action of that Anglo-Saxon poem takes place. Among other works of the medieval imagination that tell of adventures at Lejre, the best known is the fourteenth-century Icelandic Saga of King Hrolf Kraki.
Archeological excavations undertaken since the 1980s have produced dramatic confirmation that medieval legends of Lejre, though largely fabulous, have a basis in history. Research teams have uncovered the remains of an extensive Iron Age and Viking Age settlement complex just outside the hamlet of Gammel Lejre. Discovered here were the post-holes for a series of large rectangular buildings measuring fifty to sixty meters in length or more. These must have been the halls of powerful magnates or kings. Outbuildings and other structures whose remains were unearthed in this same area indicate that Lejre was also a center for crafts, commerce, and religious observances. The relative absence of weapon finds suggests that the site was more important as a social and economic center than as a military base. A noteworthy loose find that has recently turned up is a tiny silver Viking Age figurine known as Odin from Lejre. This is thought to depict the god Odin enthroned in majesty between ravens.
Other sites of archaeological interest in the vicinity, long admired by visitors even when their nature was not well understood, are a Viking-Age cemetery that includes several ship settings, a great Iron Age cremation mound, a number of tumuli that are mostly of Bronze Age date, and several Neolithic chamber graves, including one that in modern times has been known as Harald Hildetandshøy. As for the Iron Age archaeological settlement complex unearthed since the 1980s, its two related parts span the period from about 550 to about 1000 AD, thus confirming the significance of this 'land of legends' over a period of almost half a millennium, up to the time when Denmark was converted to Christianity and a new royal capital was established at what is now the cathedral city of Roskilde.
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.