The conquest of Italy brought Charlemagne into renewed contact with the Saracens, who, at the time, controlled the Mediterranean. Pippin, his son, spent years fighting with the Saracens in Italy. To keep the area under control, Charlemagne conquered Corsica and Sardinia in the 790s and the Balearic Islands, which were often attacked by Saracen pirates, in 799. The counts of Genoa and Tuscany, with their large fleets of fighting warships, kept the Saracens at bay until the end of Charlemagne’s reign.
Charlemagne’s reach extended even to places that would have been considered alien worlds, even for the well-traveled king: he had diplomatic contact with the caliphal court in Baghdad. In 797, the caliph of Baghdad, Harun al-Rashid, presented Charlemagne with an Asian elephant named Abul-Abbas and gave him the additional gift of a clock. The decadence and violence seen in the Christian capitals would have been a sharp contrast to the splendor and sophistication of the Muslim court.
Charlemagne’s younger son Louis was in charge of the Spanish border, and in Hispania the struggle against the Moors continued without end. In 785, Louis’s men captured Gerona and extended Frankish control into the Catalan littoral for the duration of Charlemagne’s reign—much longer, actually, as it remained Frankish until the Treaty of Corbeil in 1258. The Muslim chiefs in the northeast of Hispania were constantly fighting against Cordoban authority, and they often turned to the Franks for help, allowing the Frankish border to slowly extend until 795, when Gerona, Cardona, Ausona, and Urgel were joined into the new Spanish March, contained within the old duchy of Septimania.
Louis had as much difficulty with the Moors as his brother Pepin did with the Saracens in Italy. Barcelona fell to the Franks in 797 when Zeid, its governor, who had rebelled against Cordoba and failed, handed it to the Franks out of spite. The greatest city of the region did not stay in Frankish hands for long—the Umayyad authority recaptured Barcelona in 799—but Louis marched the entire army of his kingdom over the Pyrenees and besieged the city for two years, wintering there from 800 to 801, until it capitulated. Seizing the victory, the Franks continued to press the emir, taking Tarragona in 809 and Tortosa in 811, a conquest that brought them to the mouth of the Ebro and allowed them to raid Valencia, prompting (the now exhausted) Emir al-Hakam I to recognize their conquests in 812.