History tells us that in the year 1100, the Muslim city of Barbastro was conquered for the Kingdom of Aragon after months of hard siege. A year later tradition states that a marvellous event took place to ratify this great Christian victory. As Balandrán, a local shepherd, was taking care of his sheep, an image of the Virgin Mary appeared above an almond tree. She entrusted him with the building of temple in her honour in the same location and this miraculous apparition resulted in the construction of the monastery of El Pueyo.
Historical records from the 11th century make reference to a castle that once stood on the site of the current building; a hill that soars to a height of 673 metres. Given the height of the hill, this would have been the perfect strategic location for the domination of huge expanse of Somontano territory. The name “Pueyo” is derived from the Latin word podio meaning “high place.”
The Gothic sepulchre of San Balandrán stands in a small room attached to the current church. He was a tall man and tradition says that Barbastro’s young people must be able to touch the ends of the sepulchre with their extended arms before entertaining aspirations of marriage.