Al-Walid I
According to early Muslim historians, towns that surrendered without resistance and made treaties with the Muslims were allowed to retain their churches and the towns captured by Muslims had many of their churches converted to mosques. One of the earliest examples of these kinds of conversions was in Damascus, Syria, where in 705 Umayyad caliph Al-Walid I bought the church of St. John from the Christians and had it rebuilt as a mosque in exchange for building a number of new churches for the Christians in Damascus. Overall, Abd al-Malik ibn Marwan (Al-Waleed's father) is said to have transformed 10 churches in Damascus into mosques.