Charlemagne, sending delegations to Toulouse and Aix-la-Chapelle in 796, 797, and 798. These diplomatic efforts may have aimed to strengthen his legitimacy and the Asturian government against ongoing internal unrest——viz., troubles in Galicia——and external attacks of the Ibn Mugait brothers, the generals Abd al-Karim and Abd al-Malik. Alfonso was acknowledged as a king by Charlemagne and the Pope, and Asturias as a kingdom for the first time. The king showed an interest in the Frankish cult of Saint Martin of Tours, and he encouraged Carolingian Church influence in Asturias. Also, during Alfonso's reign, the alleged resting place of St. James was revealed. Alfonso's envoys to Charlemagne's courts may have also dealt with the adoptionist controversy, which had brought Bermudo's kingdom into Charlemagne's view. It seems that Carolingian support did much to spur his raid into Andalusian territory up to Lisbon, which was captured and sacked by his troops in 798. Later events In 825, he defeated Cordovan forces at Narón and Anceo and, thanks to these victories, the "repopulation" of parts of Galicia, León, and Castile was started— with charters granted that confirmed the possession of the territories. Alfonso also moved the capital from Pravia, where Silo had located it, to Oviedo, the city of his father's founding and his birth. There he constructed churches and a palace. He built San Tirso, where he is buried, and Santullano, on the outskirts. The Crónica Sebastianense records his death in 842, saying: tras haber llevado por 52 años casta, sobria, inmaculada, piadosa y gloriosamente el gobierno del reino [after having held for 52 years chastely, soberly, immaculately, piously, and gloriously the government of the realm] Tradition relates that in 814, the body of Saint James was discovered in Compostela and that Alfonso was the first pilgrim to that famous medieval (and modern) shrine. References 8th-century births 842 deaths Beni Alfons 8th-century Asturian monarchs 9th-century Asturian monarchs