It is 1,239 years since the Battle of of Roncevaux Pass, where a large force of Basques ambushed a part of Charlemagne's army in the Pyrenees on the present border between France and Spain, after his invasion of the Iberian Peninsula. As the Franks retreated across the Pyrenees back to France, the rearguard of Frankish lords was cut off, stood its ground, and was wiped out.
In 777, Charlemagne was courted by Sulaiman Ibn al-Arabi, the wali, or governor, of Barcelona. Al-Arabi was keen to form an alliance with Charlemagne, in the hope that such a powerful ally would protect him from invasion. He assured Charlemagne that if the Frankish armies crossed the Pyrenees, they would meet with little resistance and could make considerable gains.
Charlemagne accepted the enticing offer, and marched into the Iberian Peninsula in early 778. His progress, as promised, was swift, and by the spring he had taken the strategically important city of Pamplona. His army continued south, intent on capturing the jewel in the crown, the city of Zaragoza. However, when Charlemagne reached the city his progress was unexpectedly halted. The city governor, Hussain Ibn al-Ansari was in no mood to submit, and vowed to repel any Frankish invasion.
After a tense standoff, during which Charlemagne laid siege to Zaragoza, a deal was eventually struck: Al-Ansari offered a substantial payment of gold, and the release of several prisoners, in return for a Frankish withdrawal. Charlemagne, pleased of an excuse to return to France where a Saxon rebellion was threatened, accepted the deal, and readied his forces for the march northwards.
During the retreat, Charlemagne ordered that the fortifications of Pamplona be destroyed, reducing the threat of it being used as a base to attack the Franks. This antagonised the local population, and can be viewed as a possible cause of the battle the followed.