The covered mosque building was originally a small prayer house erected by Umar, the second caliph of the Rashidun Caliphate, but was rebuilt and expanded by the Umayyad caliph Abd al-Malik and finished by his son al-Walid in 705 CE. The mosque was completely destroyed by an earthquake in 746 and rebuilt by the Abbasid caliph al-Mansur in 754. It was rebuilt again in 780. Another earthquake destroyed most of al-Aqsa in 1033, but two years later the Fatimid caliph Ali az-Zahir built another mosque whose outline is preserved in the current structure. The mosaics on the arch at the qibla end of the nave also go back to his time.
During the periodic renovations undertaken, the various ruling dynasties of the Islamic Caliphate constructed additions to the mosque and its precincts, such as its dome, facade, its minbar, minarets and the interior structure. When the Crusaders captured Jerusalem in 1099, they used the mosque as a palace and the Dome of the Rock as a church, but its function as a mosque was restored after its recapture by Saladin in 1187. More renovations, repairs and additions were undertaken in the later centuries by the Ayyubids, Mamluks, Ottomans, the Supreme Muslim Council, and Jordan. Today, the Old City is under Israeli control, but the mosque remains under the administration of the Jordanian/Palestinian-led Islamic Waqf.
Al-Masjid al-Aqsa translates from Arabic into English as "the farthest mosque". The name refers to a chapter of the Quran called Al-Isrā’ (Arabic: ٱلْإِسْـرَاء), "The Night Journey"), in which it is said that Muhammad travelled from Mecca to "the farthest mosque", and then up to Heaven on a heavenly creature called al-Burāq ash-Sharīf (Arabic: ٱلْـبُـرَاق الـشَّـرِيْـف).