Alfonso III (c. 848 – 20 December 910), called the Great (Spanish: el Magno), was the king of León, Galicia and Asturias from 866 until his death. He was the son and successor of Ordoño I. In later sources he is the earliest to be called "Emperor of Spain." He was also titled "Prince of all Galicia" (Princeps totius Galletiae).
 Alfonso's reign was notable for his comparative success in consolidating the kingdom during the weakness of the Umayyad princes of Córdoba. He fought against and gained numerous victories over the Muslims of al-Andalus.
 During the first year of his reign, he had to contend with a usurper, Count Fruela of Galicia. He was forced to flee to Castile, but after a few months Fruela was assassinated and Alfonso returned to Oviedo.
 He defeated a Basque rebellion in 867 and, much later, a Galician one as well. He conquered Porto and Coimbra in 868 and 878 respectively. In about 869, he formed an alliance with the Kingdom of Pamplona, and solidified this link by marrying Jimena, who is thought to have been daughter of king García Íñiguez, or less likely, a member of the Jiménez dynasty, and also married his sister Leodegundia to a prince of Pamplona.
 The following year, 867, Alfonso had to attend to an uprising in the eastern part of the kingdom, in Alava, according to the Chronicle of Albeda. According to the Chronicle of Sampiro, the revolt was led by Count Eylo. Sampiro describes these events as follows:
  A messenger arrived from Álava, announcing that their hearts had inflated against the king: hearing that, the monarch decided to march there.  Driven by the fear of their arrival, they quickly recognized their obligations and supplicants, lowered their heads before him and promised that they would remain faithful to his kingdom and authority, and that they would do what was commanded.  In this way he submitted to his power an Alava lying before him, and Eylo, who presented himself as his count, brought him to Oviedo loaded with iron. His father, Ordoño, had begun the resettlement of the border territories and Alfonso continued with it.  His first successes were in Portuguese lands, where King Alfonso's troops succeeded in locating the southwestern frontier on the Mondego river.  Count Vimara Perez in 868 conquered Porto and resettled the district. In 878, the army of King Alfonso III, with Count Hermenegildo Gutiérrez in command, faced the Muslim forces led by the emir of Cordoba, Mohammad I, who had started an attack against Porto. After defeating the emir's forces and expelling the Muslim inhabitants of Coimbra and Oporto, Gutiérrez' Christian troops occupied and repopulated other cities, such as Braga, Viseo and Lamego, with men taken from Galicia. Coimbra, Lamego and Viseo were conquered again in 987 by Almanzor and it was not until 1064 when they were finally reconquered by King Ferdinand I of León.
 Alfonso III had to face the offensive of the Umayyad prince al-Mundir, son of Mohamed I. Fighting occurred almost constantly between 875 and 883. The first Umayyad raids were aimed at León and El Bierzo, but failed.  The Christian counteroffensive ended with the taking of Deza and Atienza.
 Abd al-Rahman ibn Marwan, the Galician, Lord of Mérida and rebel against the Emir of Córdoba, sent him to ingratiate himself with him to the Minister of this, Hashim ibn Abd al-Aziz.[clarification needed] Accordingly, in 878, Al-Mundir  directed his armies back to Leon and Astorga, while Salid ben Ganim reached the Órbigo.  Alfonso, hoping to prevent the union of both armies, went out to meet the second, which he defeated in the battle of Polvoraria, at the confluence of the Órbigo and Esla rivers.  Al-Mundir then withdrew, but Alfonso III intercepted him in the valley of Valdemora, where he defeated him.  Mohamed was forced to pay ransom and sign a three-year truce, the first time that Córdoba had asked for peace.
 Both kings considered the truce as a pause while preparing for the next assault: Mohamed raised a fleet to attack Galicia, but it was destroyed by a storm. Alfonso and Ibn Marwan descended through the Tagus Valley and defeated the Cordovan army on Mount Oxifer, next to the Guadiana River.
 As revenge, Mohamed attacked the kingdom of Zaragoza in 882, where Alfonso had sent his son Ordoño to be educated with the Banu Qasi, sons of Musa, advancing through the ancient Roman road to Leon.  There was an exchange of prisoners and the Cordovans withdrew.  They repeated the campaign in 883 with the same result.  In 884 Mohamed I and Alfonso III signed a peace, since both began to have serious internal problems.  The great king was met with a rising led by his brothers Fruela, Odoario and Bermudo, who became strong in Astorga, supported by several counts, but were quickly defeated and executed.  In 901 the Umayyad rebel Ibn al-Qitt proclaimed Mahdi, preached holy war and attacked Zamora - "rebuilt and repopulated by Mozarabic Toledo [...] the most important advanced square of the Asturian kingdom" - which he was able to resist.  The messianic leader, abandoned by his own, was defeated and killed in battle on what is known as the Day of Zamora. In those years, the emirate of Cordoba, wracked by civil disorder, stopped disturbing the kingdom of Asturias. Alonso faced off against his former allies in Mérida and the Ebro valley: allied with the Count of Pallars, he instigated a coup that managed to defeat the Banu Qasi and install a Navarrese, Sancho Garcés I, on the throne of Pamplona.
 He ordered the writing of three chronicles which held the theory that the kingdom of Asturias was the rightful successor of the old Visigothic kingdom. Alfonso was also a patron of the arts, like his grandfather before him. He built the church of Santo Adriano. According to a letter of disputed authenticity dated to 906, the Epistola Adefonsi Hispaniae regis, Alfonso arranged to purchase an "imperial crown" from the cathedral of Tours.
 In 909, Alfonso moved the seat of his government to Oviedo.  According to Sampiro, his sons (García, Ordoño, Gonzalo, Fruela and Ramiro) conspired against him, under the influence of García's father-in-law. Alfonso had García imprisoned but the conspirators were able to free him and he fled to Boiges. However, Alfonso later convinced García to join him in a campaign against the Moors. Alfonso died in Zamora of natural causes in 910, having reigned for 44 years. Ibn Hayyan likewise tells of an uprising, but says that Alfonso himself was imprisoned. Following his death, the kingdom was divided among his sons: his eldest son, García, became king of León; the second son, Ordoño, reigned in Galicia; and Fruela received Asturias with Oviedo as his capital. These lands would be reunited when García died childless and León passed to Ordoño, while on Ordoño's death the lands were reunited under Fruela. However, Fruela's death the next year started a series of internal struggles that led to unstable succession for over a century.