Overview
The siege of Barcelona was a military operation by a Carolingian army with the aim of conquering the city of Barcelona, which had been under Muslim control for 80 years. The siege and conquest were part of the expansion of the Marca Hispanica and the constitution of the County of Barcelona by the Carolingians.
Background
In the beginning of the 8th century when the Visigothic Kingdom was conquered by the Muslim troops of the Umayyad Caliphate, Barcelona was taken by the Muslim wali of Al-Andalus, Al-Hurr ibn Abd al-Rahman al-Thaqafi. After the failure of the Muslim invasion of Gaul at the Battles of Toulouse in 721 and Tours in 732, the city was integrated into the Upper March of Al-Andalus.
From 759 onwards the Frankish Kingdom embarked on the conquest of the territories under Muslim domination. The capture of the city of Narbonne by the forces of the Frankish king, Pepin the Short, brought the border to the Pyrenees. The Frankish advance was met with failure in front of Zaragoza, when Charlemagne was forced to retreat and suffered a setback in Roncevaux in the hands of Basque forces allied with the Muslims. But in 785, the rebellion of the inhabitants of Girona, who opened their gates to the Frankish army, pushed back the border and opened the way for a direct attack against Barcelona. Rostaing, a relative of Charlemagne, was appointed head of a vast county which also extended over the ancient pagi of Girona, Empúries and Besalú.
The Emirate of Cordoba was then in a crisis: the Umayyad Emir Al-Hakam I, ascended to the throne in 796 and had to fight against the claims of his uncles, Sulayman and Ubayd-Allah Abu-Marwan, who had rebelled after the death of Hisham I. In 798, the Count of Toulouse and Marquis of Septimania, William of Gellone, was responsible for coordinating operations for the conquest of the Upper March of Al-Andalus. He called an assembly in Toulouse, attended by ambassadors of the King of Asturias, Alfonso II, and Bahlul Ibn Marzuq, a muwallad leader in revolt against Emir Al-Hakam I, who had seized Zaragoza. In 799, Bahlul also seized Huesca after driving out the Banu Salama, a family loyal to Al-Hakam I.
From Wikipedia (CC BY-SA 4.0).