In 1094 Sancho Ramirez reinforced the castle to help with the siege of the Muslim stronghold of Wasqah (Huesca); here he met his death by a stray arrow as he was reconnoitering the city's walls. The city was conquered in 1096 by Peter I of Aragon, after defeating the relief forces in the Battle of Alcoraz.