Alfonso II of Asturias

Alfonso II of Asturias (c. 760 – 842), nicknamed the Chaste (Spanish: el Casto), was the king of Asturias during two different periods: first in the year 783 and later from 791 until his death in 842. Upon his death, Nepotian, a family member of undetermined relation, attempted to usurp the crown in place of the future Ramiro I.
During his reign, which covered a span of 51 years, Alfonso discovered the supposed tomb of St. James the Great (called Santiago in Spanish) in the town of Compostela, which later became known as the city of Santiago de Compostela. He was the son of Fruela I and Munia, a Basque woman captured and brought back to Asturias by the former following a military campaign.
He was born in Oviedo in 759 or 760. He was put under the guardianship of his aunt Adosinda after his father's death, but one tradition relates his being put in the Monastery of San Xulián de Samos. He was the governor of the palace during the reign of Adosinda's husband Silo. On Silo's death, he was elected king by Adosinda's allies, but the magnates raised his uncle Mauregatus to the throne instead. Alfonso fled to Álava where he found shelter with his maternal relatives. Mauregatus was succeeded by Bermudo I, Alfonso's cousin, who abdicated after his defeat at the Battle of the Burbia River.
Alfonso was subsequently elected king on 14 September 791. Poets of a later generation invented the story of the secret marriage between his sister Ximena and Sancho, count of Saldana, and the feats of their son Bernardo del Carpio. Bernardo is the hero of a cantar de gesta written to please the anarchical spirit of the nobles.
Alfonso 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 the churches of San Tirso, where he is buried, and of San Julián de los Prados (aka Santullano), high above overlooking the nascent city.
On accession to the throne, Hisham I, son of Abd al-Rahman I, commenced a string of military campaigns in the eastern Pyrenees and to the north-west. In 794, a raid spearheaded by Abd al-Karim dealt a major military blow to Alfonso II on the eastern fringes of the Kingdom of Asturias (Cantabria and Castile). The Asturian king asked for the assistance of the Basque Frankish vassal Belasco, master of Álava and bordering regions at the time. Abd al-Karim advanced deeper west into Asturias and pillaged the region, while his brother Abd al-Malik ventured into the western Asturian lands.
Under pressure from his enemies, Alfonso II reached out to Charlemagne, sending delegations to Toulouse and Aix-la-Chapelle in 796, 797, and 798. These diplomatic efforts, proffered by Froia and later Basiliscus, 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 in the Royal Frankish Annals. The king showed an interest in the Frankish cult of Saint Martin of Tours, and he encouraged Carolingian Church influence in Asturias.
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.
Also, during Alfonso's reign, the alleged resting place of St. James was revealed. Tradition relates that in 814, the body of Saint James was discovered in Compostela and that Alfonso was the first pilgrim to the shrine at Libredón.
In 825, he defeated Saracen forces at Narón (near Ferrol) and also in year 825 Anceo (in the hills equidistant from Pontevedra and Vigo), and, thanks to these victories, the "repopulation" of parts of Galicia, León, and Castile was started— with charters confirming the possession of the territories.
The Crónica Sebastianense records his death in 842, saying: