Moratalla Castle, locally known as Castillo de Moratalla, lies in the town of the same name in the province of Murcia in Spain.
The conical hill on which Moratalla Castle is situated was already inhabited in Neolithic times. During the Iberian era a stone defensive building was built here, which may also have been in use in Roman times.
In the 9th century, during the Islamic period, Moratalla Castle was built over the Iberian remains to strengthen the defence of the border of Al-Andalus at the time.
In 1147 the castle was occupied by Yusuf ibn Hilal who was rebelling against his nephew Abu ʿAbd Allāh Muḥammad ibn Mardanis, nicknamed 'the Wolf King', who was emir of the Taifa of Murcia. During a raid Yusuf was captured by his nephew. The Wolf King then brought him in front of the walls of Moratalla Castle. There Yusuf's eyes were gouged out while his wife was looking down from the castle's battlements, to force her to surrender the castle.
In 1242 Moratalla Castle was conquered by the troops of Ferdinand III of Castile, led by Paio Peres Correia. Paio was Grand Master of the Order of Santiago, so Ferdinand gave the castle to the Order as thanks.
The Order rebuilt the castle, adding the square, 22 meters high, keep during the 15th century. Also the town was given walls, which connected with the castle. It kept its strategic importance until the 16th century because of its position bordering the Kingdom of Granada.
In 1747 it was described as being abandoned. In 1865 the castle became a wine storage until the 1930's, when it was bought by the town council.
At present Moratalla Castle can be visited, I think, but it was closed when I came by. A very nice castle.