Barbastro was the capital and principal city of the Muslim province of Barbithaniyya. In the year 802 the capital consisted of a castle on a large rocky platform, which had been founded by Jalaf ibn Rhasıd ibn Asad in the first half of the 9th century. This city was referred to as a fully consolidated medina for the first time in 886-887, indicating rapid development over the second half of the 9th century. Its new status explains why, in the year 918, Amrhus ibn Muhammad ordered the construction of a new boundary wall made of ashlars and equipped with its own towers, demonstrating the success of Jalaf’s original settlement. Al-Himyarhi, one of the Muslim leaders at the time, considered this wall to be one of the strongest in the whole of the northern reaches of the Muslim empire.
It must have been during the 10th century when the castle on the so-called Rock of the Sepulchre was transformed as a suda, an Arabic fortress where the governor of the town and the district lived. At this time the city had a number of neighbourhoods, bathing areas and a mosque.
The Christian kingdom of Aragon, which rose in the 11th century, achieved its first great victory against Islam in 1064 with the taking of Barbastro by Sancho Ramiréz. Knights from all over Europe took part in the conquest; the count of Urgell, the duke of Aquitaine, several French warriors and nobles from Catalunya and Normandy. They took control of the poor districts of the city and from there besieged the city for months.
The conquest of Barbastro was referred to as the First Crusade. It was Pope Alexander II (1061-1073) who first used his power as pope to promote the fight against Islam as a Holy War and entrusted this campaign to the French nobility. The war converted the newly occupied zones into vassals of the Apostolic Headquarters. Sancho Ramirez, the Aragonese king, needed to strengthen his small Pyrenean kingdom against Navarra and Castilla and so yielded to Rome as a way of guaranteeing independence and gaining political strength.
The fall of Barbastro was a great loss for Islam as is reflected in the words of Ibn Hayyhan (988-1076), full of sentiment when he said:
“In the year 456 (25th December 1063 to 12th December 1064) the enemy took Barbastro, the most important stronghold of Barbithanyya, located between Lérida and Zaragoza, the two columns of the Northern Front. Of Barbastro, this venerable mother, where Islam had flourished after the conquest of Mhusa ibn Nusayr, which during centuries had achieved continuous prosperity, which was glorified for its fertile territory and its strong walls, which was built on the banks of the Vero, it was the bastion of the inhabitants of the frontier against attacks from enemies, which for three hundred and sixty three years had been under Muslim rule, in a way that religion had deep roots there and where the Koran was studied in a perpetual manner. Since then this sad event has been the only topic of conversation and the whole world imagines that Córdoba will soon suffer the same fate.”
However, the objective of that first conquest of Barbastro was less about consolidating the area around Barbastro and more about the immediate attainment of wealth and slaves. Because of this, a Muslim army directed by al-Muqtadir, King of Zaragoza, retook the city from the Christians eight months later. The combination of the Aragonese defeat in Graus in 1063 and this one in Barbastro two years later, delayed further Christian advances by a quarter of a century.
The gallop towards the second and definitive conquest of Barbastro in the year 1100 started in April of the previous year. This was the month during which Pedro I used a municipal charter to grant privileges to every person who came to settle in the castle of El Pueyo in Barbastro, from where he controlled practically all the rural land surrounding the city.
In this way, the war developed without the drama of spectacular and bloody fights and instead became a slow process more suited to small feudal armies.
When the Christians eventually conquered Barbastro they quickly started to reorganise the city. The Bishop of Roda moved to Barbastro and the mosque was consecrated as a cathedral in May 1101. The king gave jurisdiction to the new settlers in an authentic institutional and social reorganisation of the city and the nearby rural villages. This was done through sharing out land, inheritances and honours.