Hadithcore
Mishkat al-Masabih, 753

Abu Dharr said that he asked God’s Messenger which mosque was set up first in the earth and was told that it was the sacred mosque. He asked which came next and was told that it was the Aqsa mosque. He asked how long a space of time separated their building and the Prophet (ﷺ) told him it was forty years, adding, “Then the earth is a mosque for you, so pray wherever you are at the time of prayer.” (Bukhari and Muslim.)

وَعَنْ أَبِي ذَرٍّ قَالَ: قُلْتُ: يَا رَسُولَ اللَّهِ أَيُّ مَسْجِدٍ وُضِعَ فِي الْأَرْضِ أَوَّلُ؟ قَالَ: «الْمَسْجِدُ الْحَرَامُ» قَالَ: قُلْتُ: ثُمَّ أَيْ؟ قَالَ: «ثُمَّ الْمَسْجِدُ الْأَقْصَى» . قُلْتُ: كَمْ بَيْنَهُمَا؟ قَالَ: «أَرْبَعُونَ عَامًا ثُمَّ الْأَرْضُ لَكَ مَسْجِدٌ فَحَيْثُمَا أَدْرَكَتْكَ الصَّلَاةُ فصل»

References1 variant
In-Book Reference
Book 4, Hadith 181
Related hadiths1
Compare isnād across 1 related chains →