The site on which the mosque stands has been used as a sanctuary for more than 3,000 years. The Aramaeans worshipped their storm god Hadad here, and the Romans built a great Temple of Jupiter on the same spot. You can still see remains of it today: the mighty columns and the gate at the end of Souq al-Hamidiyah once belonged to the temple precinct.
In Byzantine times, a church dedicated to John the Baptist was built on the site. After the arrival of Islam in the 7th century, the caliph al-Walid I had today's mosque built in its place. Craftsmen from many parts of the empire worked on the building, which became a model for later mosques throughout the Islamic world.
Over the centuries the mosque was extended and renewed several times, most recently extensively after a fire in 1893. Its basic form from the Umayyad period has been preserved to this day.