The medieval castle of Carcabuey was the object of incursions by Ibn Hafsun at the end of the Emirate, being dominated and demolished by the emir Add-Allah in 892. Conquered by Fernando III, it was rebuilt according to the design of other fortifications, such as those in Fuengirola or Iznájar.
From the mid-13th century, it belonged to the Order of Calatrava, until, in 1333, it was conquered by Muhammad IV of Granada and reconquered and modified shortly after by Alfonso XI. It was integrated into the Señorío de Aguilar after numerous donations.
The fortress has five towers distributed along the wall, of which two are square and three circular. Inside the walled enclosure, the keep remains well-preserved. In the upper part of the courtyard sits the eighteenth-century chapel, Ermita de Nuestra Señora del Castillo.
The castle itself has gone down in history for the battle between King Alfonso X and his rival, Sancho. According to legend, the King had ordered everyone not to leave the castle under any circumstances. His rival knew that, in order to emerge victorious over the local population, he needed to flush the army out onto open ground. He learned that the Governor's daughter had a 'secret' lover and therefore devised a plan to lure her away from the castle to meet her true love and escape together. He was sure that the Governor would call out the troops to go after the girl and return her. The Governor, Pero Nuño Tello, was committed to total loyalty to his King and refused to send out the troops, thus losing his daughter forever as she fled with her lover. Interestingly, when Sancho later became King, he was sorry for the injury he had caused to the Governor and called Pero to his court to make amends. However, he was only able to meet with Pero's dead body as the Governor committed suicide, feeling that his dead body was the only loyal part of himself that he could present to the new king. His spirit, as the legend goes, would never bow to Sancho.References:
Kristiansten Fortress was built to protect the city against attack from the east. Construction was finished in 1685. General Johan Caspar von Cicignon, who was chief inspector of kuks fortifications, was responsible for the new town plan of Trondheim after the great fire of 18 April 1681. He also made the plans for the construction of Kristiansten Fortress.
The fortress was built during the period from 1682 to 1684 and strengthened to a complete defence fortification in 1691 by building an advanced post Kristiandsands bastion in the east and in 1695 with the now vanished Møllenberg skanse by the river Nidelven. These fortifications were encircled by a continuous palisade and thereby connected to the fortified city. In 1750 the fortress was modernized with new bastions and casemates to protect against mortar artillery.