Burgalimar Castle was built in the 10th century under the rule of the Umayyad Caliphate of Córdoba.
A marble inscription plaque found at the entrance of the castle records the date of its construction as 967 AD, during the reign of the caliph Al-Hakam II, who is also named in the inscription. The marble plaque is now kept at the National Archaeological Museum in Madrid. The castle was built as a military base and garrison to defend the valley of the Guadalquivir River and the roads to and from the capital city of Córdoba.
During the 12th and 13th centuries (part of the period known as the Reconquista), the castle changed hands multiple times between the Muslim rulers of Al-Andalus and the Christian kingdoms to the north. Alfonso VII captured it in 1147 but it returned to Muslim control after his death in 1157. Alfonso VIII and Alfonso IX together captured it again for a time in 1189. It was captured by the Kingdom of Castile in 1212, shortly before the Battle of Las Navas de Tolosa, but returned to Almohad control three days after the battle. The castle was definitively conquered by Castile in 1225, when it conquered the surrounding region. The Castilians later added a keep tower called the Torre del Homenaje in 1466.
The castle consists of a large walled enclosure, of elongated but irregular shape, measuring roughly 100 meters long and 50 meters wide. Fifteen towers stand at close intervals around the perimeter. All the towers have a square or rectangular base, which was typical of caliphal fortresses in the 10th century, except for the northernmost tower, the 15th-century Torre del Homenaje, which is larger and has a semi-round profile. There are two entrance gates: one in the north and one in the south/southeast. The more important southern gate consists of a straight passage (instead of the bent entrance common in later fortifications) with horseshoe arches, set between two towers. Chambers were located above the passage with slots in the floor where missiles could be thrown down onto attackers. Inside the castle today are the remains of a cistern and the foundations of later buildings.
References:Prunn Castle is perched on an almost vertical Jurassic outcrop high above the Altmühl river valley south-west of Regensburg. Its impressive appearance from a distance is matched by the views from the castle of the surrounding Altmühltal countryside.
Lords of Prunn were first mentioned in 1037, and they will have certainly chosen the site because of its favourable position on several transportation routes. The castle itself dates from around 1200, a time when many castles were being built. The Danube region centring around Kelheim became very important in this period under the Bavarian duke Ludwig I. One of the oldest parts of the castle is the 31-metre keep.
In 1288, Duke Ludwig of Bavaria acquired the castle from the lords of Prunn-Laaber. In the first half of the 14th century the duke then invested the Fraunberg vom Haag family with the castle.