From the eleventh to the thirteenth centuries, power in the Iberian Peninsula shifted from Muslim to Christian rulers. In the eleventh century divisions and civil war in the caliphate of Córdoba allowed Christian armies to conquer an increasingly large part of the Iberian Peninsula. Castile, in the north-central part of the peninsula, became the strongest of the growing Christian kingdoms, and Aragon, in the northeast, the second most powerful. In 1085 King Alfonso VI of Castile and León captured Toledo in central Spain. The following year forces of the Almoravid dynasty that ruled much of northwestern Africa defeated Christian armies, and halted Christian advances southward, though they did not retake Toledo. The Almoravids reunified and strengthened the Muslim state for several generations, but the Christians regrouped, and in their North African homeland the Almoravids were overthrown by a rival dynasty, the Almohads, who then laid claim to the remaining Muslim territories in southern Spain.
Alfonso VIII (1158–1214) of Castile, aided by the kings of Aragon, Navarre, and Portugal, crushed the Almohad-led Muslims in 1212, accelerating the Christian push southward. Over the next several centuries, successive popes gave Christian warriors in the Iberian Peninsula the same spiritual benefits that they gave those who traveled to Jerusalem, such as granting them forgiveness for their sins, transforming this advance into a crusade. Christian troops captured the great Muslim cities of Córdoba in 1236 and Seville in 1248. With this, Christians controlled nearly the entire Iberian Peninsula, save for the small state of Granada (Map 9.3). The chief mosques in Muslim cities became cathedrals, and Christian rulers recruited immigrants from western and southern Europe. The cities quickly became overwhelmingly Christian, and gradually rural areas did as well. Fourteenth-century clerical writers would call the movement to expel the Muslims the reconquista (reconquest), a sacred and patriotic crusade to wrest the country from “alien” Muslim hands. This idea became part of Spanish political culture and of the national psychology.