After the migration of the Vandals and Alans down the Mediterranean coast of Hispania from 408, the history of medieval Spain begins with the Iberian kingdom of the Arianist Visigoths (507–711), who were converted to Catholicism along with their king Reccared in 587.
From Northern Africa in 711, the Muslim Umayyad Caliphate crossed into Spain, at the invitation of a Visigothic clan to assist it in rising against King Roderic.
The border between Muslim and Christian lands wavered southward through 700 years of war, which marked the peninsula as a militarily contested space.
The Middle Ages in Spain are often said to end in 1492 with the final acts of the Reconquista in the capitulation of the Nasrid Emirate of Granada and the Alhambra decree ordering the expulsion of the Jews.
The Vandals, after establishing themselves in Baetica, to which they gave the name of Vandalusia (Andalusia), passed on into Africa, while the Visigoths hemmed in the Suebi in Galicia until the latter were completely brought under control.
These Visigoths, or Western Goths, after sacking Rome under the leadership of Alaric (410), turned towards the Iberian Peninsula, with Athaulf for their leader, and occupied the northeastern portion.
[1] Euric (466), who put an end to the last remnants of Roman power in the peninsula, may be considered the first monarch of Spain, though the Suebians still maintained their independence in Galicia.
[1] Athanagild, having risen against King Agila, called in the Byzantine Greeks and, in payment for the succour they gave him, ceded to them the maritime places of the southeast (554).
Liuvigild restored the political unity of the peninsula, subduing the Suebians, but the religious divisions of the country, reaching even the royal family, brought on a civil war.
St. Hermengild, the king's son, putting himself at the head of the Catholics, was defeated and taken prisoner, and suffered martyrdom for rejecting communion with the Arians.
Don Pelayo, or Pelagius, the Gothic chieftain who was victor at Covadonga, was acclaimed king, and took up his residence at Cangas de Onís.
[1] Sancho III, the Great, was one of the monarchs who most influenced Spanish history; he was eventually King of Navarre, Castile, Aragón, and Sobrarbe.
At his death (1035) he divided his kingdoms, giving Navarre to his eldest son García, Castile, with the title of King, to Fernando, Aragón to Ramiro, and Sobrarbe to Gonzálo.
In the same way Catalonia and Aragon entered into a personal union by the marriage of Ramon Berenguer IV with Doña Petronila, daughter of Ramiro the Monk, of Aragón.
[1] The monarchy formed by the dynastic union of Aragon and Catalonia was the first to complete the Reconquest in their regional area, they then directed their strength eastward.
Peter II the Catholic, sovereign of Aragon and Catalonia, went to Rome to seek the annulment of his marriage with Maria of Montpellier and to have himself crowned by the pope.
The former purpose he failed to accomplish; the latter occasioned him a great deal of trouble, as the Aragónese nobles refused to recognize the position of vassalage to the Holy See in which Peter had placed his kingdom.
Peter II the Catholic, fell in the Battle of Muret (1213), defending his Albigensian kinsmen against Simon de Montfort, whom Innocent III had sent against them.
His son and successor gave new direction to Catalan-Aragónese policy by enforcing the rights of his wife, Constance, to the kingdoms of Sicily and Naples.
Martin IV, having excommunicated Peter III, led the Aragónese nobles to take advantage in extending their privileges at the expense of royal power.
The demands of the nobles increased in the reign of Alfonso III, who was forced to confirm to them the famous Privilegio de la Union.
Having conquered them, they turned their arms against the Greeks, who treacherously slew their leaders; but for this treachery the Spaniards, under Bernard of Rocafort and Berenguer of Entenca, exacted the terrible penalty which is celebrated in history as "The Catalan Vengeance" and moreover seized the Duchies of Athens and Neopatras (1313).
The royal line of Barcelona-Aragon became extinct with Martin the Humane, and the Compromise of Caspe (1412) gave the Crown to the dynasty of Castile, thus facilitating a future dynastic union.
Alfonso V, the Magnanimous, once more turned Aragonese policy to the direction of Italy, where he possessed the Kingdom of Sicily and acquired that of Naples by having himself made adoptive son of Queen Joanna.
Alfonso XI was little more than one year old when his father died (1312); and though his reign was in many respects glorious, and he overcame the Marinids in the Battle of Río Salado (1340), still his relationship with Eleanor de Guzmán, by whom he had several children, resulted in the wars of the following reign, that of Pedro the Cruel, who was at last slain by his bastard brother, Henry of Trastámara, and succeeded on the throne as Henry II.
Henry III, who married Catherine of Lancaster, was the first to take the title of Prince of Asturias as heir to the Crown, which he inherited during his minority, as did his son, John II.
Alfonso X commissioned a translation of an Arabic work on chess, dice and tables games called the Libro de los Juegos in 1283.
Cities were cultural and administrative centers, the seats of bishops and sometimes kings, with markets and housing expanding from a central fortified stronghold.