the emir managed to recapture it in 799, but Louis, at the head of an army, crossed the Pyrenees and besieged the city for seven months until it finally capitulated in 801. The main passes in the Pyrenees were Roncesvalles, Somport and La Jonquera. Charlemagne established across them the vassal regions of Pamplona, Aragon, and Catalonia respectively. Catalonia was itself formed from a number of small counties, including Pallars, Girona, and Urgell; it was called the Marca Hispanica by the late 8th century. They protected the eastern Pyrenees passes and shores and were under the direct control of the Frankish kings. Pamplona's first king was Iñigo Arista, who allied with his Muslim kinsmen the Banu Qasi and rebelled against Frankish overlordship and overcame a Carolingian expedition in 824 that led to the setup of the Kingdom of Pamplona. Aragon, founded in 809 by Aznar Galíndez, grew around Jaca and the high valleys of the Aragon River, protecting the old Roman road. By the end of the 10th century, Aragon, which then was just a county, was annexed by Navarre. Sobrarbe and Ribagorza were small counties and had little significance to the progress of the Reconquista. In the late 9th century under Count Wilfred, Barcelona became the de facto capital of the region. It controlled the other counties' policies in a union, which led in 948 to the independence of Barcelona under Count Borrel II, who declared that the new dynasty in France (the Capets) were not the legitimate rulers of France nor, as a result, of his county. These states were small and, with the exception of Navarre, did not have the capacity for attacking the Muslims in the way that Asturias did, but their mountainous geography rendered them relatively safe from being conquered, and their borders remained stable for two centuries. Northern Christian realms The northern principalities and kingdoms survived in their mountainous strongholds (see above). However, they started a definite territorial expansion south at the turn of the 10th century (Leon, Najera). The fall of the Caliphate of Cordova (1031) heralded a period of military expansion for the northern kingdoms, now divided into several mighty regional powers after the division of the Kingdom of Navarre (1035). A myriad of autonomous Christian kingdoms emerged thereafter. Kingdom of Asturias (718–924) The Kingdom of Asturias was located in the Cantabrian Mountains, a wet and mountainous region in the north of the