I asked, "Messenger of Allah, which mosque was the first to be built on earth?"He replied, "The Sacred Mosque."I asked, "Then which?"He replied, "Masjid al-Aqsa."I asked, "How long was the period between them?"He replied, "Forty years. Then wherever the time of prayer overtakes you, pray, for the merit lies therein."In Muslim's wording, "Pray, for it is a mosque."
قلت: يا رسول الله! أي مسجد وضع في الأرض أول، قال: المسجد الحرام قلت: ثم أي؟ قال: المسجد الأقصى قلت: كم بينهما؟ قال: أربعون سنة. ثم أينما أدركتك الصلاة فصله، فإن الفضل فيه. وفي لفظ مسلم: فصله فإنه مسجد.
Narrated by Bukhari in the chapters on the prophets (3366), and Muslim in the book of masjids (520), both from the hadith of Abdul-Wahid, from Amash, who said, Ibrahim Taymi narrated to us, from his father, who said, I heard Abu Dharr, and he related it.His saying, "forty years," means that when Ibrahim built Masjid al-Haram in Makkah and returned to Palestine, he built another masjid for his other sons, but this masjid fell into ruin. When king Dawud
came to power, he rebuilt this ruined masjid, and his son Sulayman
completed it, so it was attributed to him. This is the masjid that was later named Masjid Aqsa, to which the Messenger of Allah ﷺ was taken on his night journey, and where he led the prophets in prayer, being the last of the prophets to inherit this masjid, after which his nation inherited it.When the Muslims conquered Bayt al-Maqdis during the caliphate of Umar bin Khattab
, Umar bin Khattab
ordered its reconstruction, because the Christians had raided Bayt al-Maqdis several times, demolishing part of it, turning part of it into a rubbish dump, and removing everything connected to Sulayman's
construction. Then the caliph Abdul-Malik bin Marwan ordered its expansion, and the caliphs and rulers continued to take care of restoring and repairing this masjid up to our present day. Through this, the masjid became the property of the Muslims, and it will remain so until the Day of Resurrection. Now there is no trace left of Sulayman's
original construction.