 Believed to stand on the site of an ancient Philistine temple , the site was used by the Byzantines to erect a church in the 5th century , but after the Muslim conquest in the 7th century , it was transformed into a mosque . Described as " beautiful " by an Arab geographer in the 10th century , the Great Mosque 's minaret was toppled in an earthquake in 1033 . In 1149 , the Crusaders built a cathedral dedicated to John the Baptist , but it was mostly destroyed by the Ayyubids in 1187 , and then rebuilt as a mosque by the Mamluks in the early 13th century . It was destroyed by the Mongols in 1260 , then soon restored only for it to be destroyed by an earthquake at the end of the century . The Great Mosque was restored again by the Ottomans roughly 300 years later . Severely damaged after British bombardment during World War I , the mosque was restored in 1925 by the Supreme Muslim Council . 
