Since its initial conquest by Arab and Berber armies in 711–715, most of the Iberian Peninsula (modern Spain and Portugal) had been under Umayyad Muslim political control between 756 and 1031. Following the collapse of the Umayyad Caliphate of Cordoba in 1031, however, al-Andalus, the Muslim-ruled portions of Iberia, had disintegrated into over two dozen emirates, known as taifas.
This fragmentation and weakening of Muslim political authority facilitated the rise of the northern Christian powers of Portugal, Navarre, Castile, León, and Aragón. Attempts by local (Andalusi) and foreign (“Berber” Almoravid, Almohad and Marinid) dynasties to resist the southward expansion of these Christian kingdoms ultimately failed, and the Battle of Las Navas de Tolosa in 1212, ending in an overwhelming defeat for the Muslims at the hands of a Christian coalition, sealed the fate of most of al-Andalus. Beginning in the eleventh century, Castile and Aragón in particular had capitalized on the collapse of the Caliphate of Cordoba and succeeded in conquering major Andalūsī cities such as Toledo in 1085, Zaragoza in 1118, Lisbon in 1147, Cuenca in 1177, Majorca and Badajoz in 1230, Cordoba in 1236, Valencia in 1238, Jaén in 1246, and Seville in 1248, Algeciras in 1344, Antequera in 1410 and Gibraltar in 1462.