To understand why this castle is here, we have to go back to the year 1085. King Sancho Ramirez of Aragon and Pamplona was determined to conquer the Muslim city of Wasqa, which we now know as Huesca. He knew he could not take it in a single day, so he built Montearagon as a castle of approach—a permanent base to harass the city and control the surrounding territory. The castle's irregular hexagonal layout followed the natural shape of the hilltop, making it nearly impossible to breach. For 11 years, the king and his son, Peter the First, used this very ground to tighten the noose around Huesca. Tragically, Sancho Ramirez never saw the final victory; he died during the siege in 1094 while inspecting the city walls. However, his strategy worked because just two years later, in 1096, Huesca finally fell into Christian hands after the legendary Battle of Alcoraz.