Along the borderlands of Al-Andalus
Catalan society developed from the ninth to the fifteenth centuries in circumstances that would leave a profound mark upon the region. A new sense of its own geography, its development as a hub of European and Mediterranean trade, its language and collective imaginary, its cultural difference, all emerged from a lengthy and often difficult process of collective formation. It was no coincidence that during this period there also evolved the political, economic and legal frameworks within which identities were forged. But in its origins in the ninth century Catalonia was just one of several small regions of old Spain (Hispania) struggling for survival along the outlying borderlands of the weakening yet still mighty empire of Al-Andalus.
‘The Christian reconquest south of the Pyrenees’, wrote Pierre Bonnassie, ‘began with a memorable defeat.’ In early summer 778, Charlemagne responded to a call for help from the Muslim governor of Barcelona, who had rebelled against his overlord in Cordoba. But Charlemagne's offensive came to nothing. Then, while retreating from Saragossa, the rearguard of the Franks’ army was ambushed in a Pyrenean mountain pass by Basque warriors. The epic defeat, which became the stuff of Roland's legend, had some positive after-effects for those unhappy with the status quo in the region. It was no coincidence that, seven years later, Girona and a number of other Catalan towns and fortifications opened their gates to Charlemagne's warriors and became united in a common purpose. Local support for the Franks must have been widespread, because Cerdanya (Cerdagne) and Urgell declared allegiance to them in 789. After Charlemagne's main deputy in the region, Guilhem, count of Toulouse, entered Barcelona in 801, with other local magnates under the command of Charlemagne's son, Louis the Pious, control of the region would never again pass to a Muslim governor. At the time, however, this prospect cannot have seemed like much of a certainty for the two thousand or so citizens of Barcelona.
The vast majority of people in the region stayed away from the coast. Most of it was deserted, apart from a few fortified positions like Barcelona, on account not only of the threat of razzias (military raids) but because of the fear of coast-hugging pirates and Viking war bands. Consequently, population was concentrated in the mountains.