Zaragoza, however, remained a Muslim city and capital of the Upper March, and later of an independent emirate until the 11th century. Pamplona, itself, would still remain in the hands of the Muslims and held until a rebellion in 798-801 expelled them as well. The Vascones would finally consolidate the Banu Qasi realm and eventually the constitution of the independent Kingdom of Pamplona in 824 after the birth of a new resistance to Carolingian rule. In that same year, the Basque army defeated another Carolingian army in the same mountain pass. The second Battle of Roncevaux Pass was almost similar to the first, with the Basques again taking advantage of the terrain, but against a much larger Frankish force. Unlike the first battle in which Charlemagne's army managed to escape, the Carolingians led by Count Aeblus were trapped and routed, and a larger number of men were slaughtered than those of Charlemagne's. Frankish vassals Aeblus and Aznar were captured by the joint forces of Iñigo Arista's Pamplona and of the Banu Qasi, consolidating the independence of both realms.