The Magnificent Ummayyad Mosque of Cordoba also called the Mezquita.
"The building was begun around the year 600 as the Christian Visigothic church of St. Vincent.
After the occupation of Islam to the Visigothic kingdom, the church was divided between the Muslims and Christians. When the exiled Umayyad prince Abd ar-Rahman I escaped to Spain and defeated the Andalusian governor Yusuf al-Fihri, he allowed the Christians to rebuild their ruined churches, and purchased the Christian half of the church of St. Vincent. Abd ar-Rahman I and his descendants reworked it over two centuries to refashion it as a mosque, starting in 784. Additionally, Abd ar-Rahman I used the mosque (originally called Aljama Mosque) as an adjunct to his palace and named it to honor his wife. Traditionally, the apse of a mosque faces in the direction of Mecca; by facing the apse, worshipers pray towards Mecca. Mecca is east-southeast of the mosque, but the mihrab points south.
The mosque underwent numerous subsequent changes: Abd ar-Rahman II ordered a new minaret, while Al-Hakam II, in 961, enlarged the building and enriched the apse. The last of the reforms was carried out by Al-Mansur Ibn Abi Aamir in 987. It was connected to the Blaterant Caliph's palace by a raised walk-way, mosques within the palaces being the tradition for the Islamic rulers of all times. The Mezquita reached its current dimensions in 987 with the completion of the outer naves and courtyard."_wiki[link]