8km/5mi northeas of Ayerbe, at the foot of the Sierra de Loarre, is Loarre. On a crag above the village stands the Castillo de Loarre, one of the finest Romanesque castles in Spain. It was built by King Sancho I Ramírez from 1076 onwards on the site of the Roman fort of Calagurris Fibularia, and was a royal residence until the 12th century. The
castle is surrounded by a double circuit of walls with round towers, above which rise the rectangular keep and the church of Santa María. The church, built over a crypt, originally belonged to an Augustinian monastery within the castle. The columns in the nave have beautiful floral capitals.