[1] The castle was built largely during the 11th and 13th centuries, when its position on the frontier between Christian and Muslim lands gave it strategic importance.
The first of the two major building programs began circa 1020, when Sancho el Mayor (r. 1063–94) reconquered the surrounding lands from the Muslims.
In 1073, King Sancho Ramírez installed a community of Augustinian canons, and it was from Loarre that he prepared for the conquest of Huesca in 1094.
The church and castle have been the subject of numerous restorations, a major one in 1913 and subsequent ones, particularly during the 1970s, have resulted in the rebuilding of many walls and towers that had fallen into disrepair.
The Torre de la Reina, comprising a basement and three floors, is particularly noteworthy for three sets of twin-arched windows, with columns of exaggerated entasis and trapezoidal capitals that have been related to both Lombard and Mozarabic architectural forms.