Ainsa is the former capital of the medieval kingdom of Sobrarbe, which extended over the valleys of Bielsa, Broto, Gistain and Puértolas. The town is surrounded by defensive walls and today is a protected monument.
Besides the beautiful Colegiate church that dates back to the 12 century, you will encounter the castle. The ancient Moorish system of fortifications was seized by Sancho el Mayor de Navarra in the 11C.
The castle was the residence of the Aragonese court in the early days of the Reconquista. A square courtyard is surrounded by high arcades
.
A five-sided tower has survived. There is a passage from the underground vaults to
the Plaza Mayor.