In the Middle Ages, Spain was ruled by the Moors. These Berber and Arab peoples from North Africa brought their cultural and religious traditions with them. Some of the mosques they built were later converted into Christian churches, but others were left untouched.
The Santa Maria Church in the Alhambra palace complex in Granada was converted from a mosque by the Catholic kings, but the original Moorish structure remains. The Santiago del Arrabal Church in Toledo was also a mosque before being converted to a church in the 16th century. The Giralda minaret in Seville originally graced the roof of the most important 16th-century mosque in Spain, when the city served as the capital of the Almohad Empire. Little remains of the mosque today. The Great Mosque of Cordoba in Andalusia is undoubtedly one of the most famous examples of Moorish architecture. Built on a Christian basilica in 785, the mosque was converted back to a church in the 13th century.
While Andalusia is reputed to have the greatest concentration of mosques, the most perfectly preserved mosques are actually in the city of Toledo. These include the Mezquita de las Tornerías (now an arts and crafts centre), the Mezquita del Cristo de la Luz and the Church of El Salvador.
There are other, more recent, mosques including two in Madrid. The Basharat Mosque in the province of Córdoba was built in 1982 and was the first to be built in Spain in 750 years.