ألفونسو السادس ملك قشتالة
The city remained in the hands of Christian troops until 1102, when the Almoravids retook the city and restored the Muslim religion. Alfonso VI of León and Castile drove them from the city, but was unable to hold it. The Almoravid Mazdali took possession on 5 May 1109, then the Almohads, seized control of it in 1171.