Alfonso II of Asturias (842), nicknamed the Chaste (), 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 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. Early life 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 proclaimed king 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 written to please the anarchical spirit of the nobles. Andalusian raids into Asturias 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. Relations with Charlemagne and the Papacy Under pressure from his enemies, Alfonso II reached out to