Visigothic kingdom of Hispania, which had been conquered by the Muslims. The first county to be conquered was Roussillon (with Vallespir) in around 760. In 785 the county of Girona (with Besalú) to the south of the Pyrenees was taken. Ribagorza and Pallars were linked to Toulouse and were added to this county around 790. Urgell and Cerdanya were added in 798. The first records of the county of Empúries (with Perelada) are from 812 but the county was probably under Frankish control before 800. After a series of struggles the County of Barcelona (with Ausona) was taken by Frankish forces in 801. A number of castles were established in Aragon between 798 and 802 (appointment of Count Aureolus). After subduing the Basques to the north of the Pyrenees (790), Frankish overlordship expanded to the upper Ebro (794) and Pamplona (798), when Alfonso II of Asturias also came under Charlemagne's influence. Sobrarbe was not incorporated into the March, as it appears later in history and was probably within the area of influence of the County of Aragon. The death of Charlemagne (814) was followed by a scene of open revolt and Carolingian setbacks around the Pyrenees. After being defeated by the Moors in the 816 Battle of Pancorbo, Pamplona, now led by the native Basque lord Iñigo Arista, broke away from the Spanish March, with the County of Aragon following suit shortly thereafter in 820. The named Catalan counties - territories used by the Moors to enter and overrun Septimania in 719 - became, at this point, a natural extension of the March of Gothia ruled by Catalans and Toulousains under the Carolingian Empire. Structure The local population of the March was diverse. The majority were Basques and Hispano-Romans (Goths). But there were also Muslims, and Jews from Septimania who repopulated the Frankish conquered easternmost territories of present-day North Spain and a small portion of South France. The area changed with the fortunes of the empires and the feudal ambitions of the counts appointed to administrate the counties. As Frankish imperial power waned, the rulers of the March of Hispania became independent fiefs. The region would later become part of Catalonia. Charlemagne's son Louis took Barcelona from its Moorish ruler in 801, thus securing Frankish power in the borderland between the Franks and the Moors. The Counts of Barcelona then became the principal representatives of Frankish authority in the Hispanic