Sayyiduna Abu Dharr Ghifari (may Allah be pleased with him) narrates: I asked, "O Messenger of Allah (peace and blessings be upon him)! Which mosque was built first on the earth?" The Prophet (peace and blessings be upon him) said: "Al-Masjid al-Haram." I asked, "O Messenger of Allah (peace and blessings be upon him)! Then which one was built after that?" He said: "Al-Masjid al-Aqsa." I asked, "What was the time span between them?" The Prophet (peace and blessings be upon him) said: "Forty years." (Then he said:) "Wherever the time of prayer comes upon you, perform the prayer there, for that place will be a mosque for you."
Hadith Referenceصحیح ابن حبان / كتاب التاريخ / 6228
Hadith Gradingفضيلة الشيخ الإمام محمد ناصر الدين الألبانيصحيح - مضى (1596). تنبيه!! رقم (1596) = (1598) من «طبعة المؤسسة». - مدخل بيانات الشاملة -.فضيلة الشيخ العلّامة شُعيب الأرناؤوطإسناده صحيح على شرط الشيخين