and Abū Dharr said:
“I asked, ‘O Messenger of Allah, which mosque was placed on earth first?’ He replied, ‘The Sacred Mosque.’ I said, ‘And then which one?’ He answered, ‘al-Masjid al-Aqsa.’
The full wording continues:
I asked, ‘How many years were between the two?’ He said, ‘Forty years. And wherever the time of prayer overtakes you, pray, for that place is a mosque.’”
It was related by al-Bukhārī, Muslim, al-Nasāʾī, Ibn Mājah, al-Bayhaqī, al-Ṭayālisī, and Aḥmad through several chains from al-Aʿmash, from Ibrāhīm al-Taymī, from his father, from Abū Dharr.
Abū ʿAwānah—whose name is al-Waḍḍāḥ ibn ʿAbd Allāh al-Yashkurī—also transmitted it from Ibrāhīm; Aḥmad recorded that version as well.
This ḥadith is an explicit proof that the Meccan Mosque is the first House set up for worship. Ibn al-ʿArabī writes in Ahkām al-Qurʾān: “This refutes those who claim that there was a House on earth before it to which the angels would make pilgrimage.” Al-Ḥāfiẓ Ibn Kathīr says in al-Bidāyah: “No sound report from an infallible source states that the House existed before the Friend (Abraham, upon him be peace). Whoever invokes the verse, ‘the site of the House’ (al-Hajj 22:26) …”