The Battle of Pancorbo was a battle that took place in the year 816 between a Moorish army from the Emirate of Cordoba sent by Al-Hakam I and under the control of Abd al-Karim ibn Abd al-Wahid ibn Mugit and the pro-Frankish forces under the control of Balask al-Yalasqi. The battle was fought when the Córdoban forces attempted to cross the pass at Pancorbo.
The battle resulted in a Córdoban victory and was instrumental in the Basque revolt and the establishment of Íñigo Arista of Pamplona as a major player in the contemporary Iberian political scene.
The Emirate of Córdoba was engulfed in conflict as Al-Hakam I fought against the pretensions of his uncles Sulaymán and Abd-Al·lah ibn Abd-ar-Rahman who had rebelled against the Córdoban establishment with the death of Hisham I of Córdoba.
The disorder in the Emirate was exploited by the Franks who in 798, convened an assembly under William of Gellone for the purpose of assisting Alfonso II of Asturias and Bahlul Ibn Marzuq against the Córdoban Emirate. Their goal was to coordinate operations to take the Upper March in the name of Louis the Pious. However, for some reason that did not happen, and the Kingdom of Asturias launched attacks upon Lisbon in 797, Velasco took over Pamplona in 798, but William of Orange and Louis the Pious launched an expedition to conquer Barcelona later in 801.
The Arabs, commanded by Muawiya ibn al-Hàkam, son of Emir Al-Hakam I, attacked Álava and the region of Castile (the Al-Quila of the Arab sources) in 801, crossing the River Ebro and the pass of las Conchas. They were surprised by Velasco, a Basque commander in control of troops from the northern Christian domains, possibly sent by Sancho I of Gascony. This surprise attack occurred at La Puebla de Arganzón and resulted in a complete rout of the Umayyad forces under Muawiya ibn al-Hàkam who was obliged to return to Córdoba (Qurtuba) after most of his best commanders and a large part of his army were wiped out.
In 803, Basque troops and members of the Banu Qasi attacked and took control of Tutila, capturing Yusuf ibn Amrus, although the city and its municipality were later retaken for Córdoba by his father, Amrus ibn Yusuf.By 806, Pamplona and the western Basque territories fell again in the hands of a Frankish vassal, Velasco (or Belasko, "Balask al-Yalasqi"), who had rebelled against the Córdoban wali in the Basque stronghold (798). He was Charlemagne's man in the Basque territories extending up to the boundaries of Alfonso II's realm. Meanwhile, in 812 Seguin was appointed dux Wasconum in Bordeaux, but soon after the spread of news of Charlemagne's death, the Basques stirred.
Abd al-Karim ibn Abd al-Wahid ibn Mugit directed the incursion of 816 into Carolingian-allied Pamplona. There the Umayyad forces pillaged the valley of Orón. Velasco, the lord of Pamplona, pled for assistance from the Kingdom of Asturias and put together an army to face the Moors.The forces met near Pancorbo, where the battle lasted for thirteen days during which the Basques planned their defence in rough fords of rivers and ravines, blocking access with logs, trenches and pits dug with their own weapons, that the Córdobans could not get through. Finally, the Christian-Basque forces took the offensive and tried to cross the river but the Córdobans had sealed off the crossing and massacred them with swords and lances. The majority of the casualties died after falling off of the cliffs surrounding the battleground. With the subsequent rains, the joint Basque-Asturian force was found ill-prepared after all their defensive works had been destroyed. Velasco was killed, along with three other leaders of the Basque-Asturians, Garcia ibn Lubb (='son of Lupus'), who was Alfonso's maternal uncle, Sancho, "the best knight of Pamplona", and the pagan warrior Ṣaltān. Their forces were forced to withdraw. However, the Córdobans were equally in a difficult situation and despite being victorious much of their army deserted the field.
The defeat of the army of Asturian-Basque Frankish vassals sparked a general revolt by the Basques against the Frankish crown and established Íñigo Arista of Pamplona as a major Basque power player in the region.