I said: Messenger of Allah, which mosque was set up first on the earth? He said: Al-Masjid al-Haram (the sacred). I (again) said: Then which next? He said: It was the Masjid Aqsa. I (again) said: How long the space of time (between their setting up)? He (the Holy Prophet) said: It was forty years. And whenever the time comes for prayer, pray there, for that is a mosque; and in the hadith transmitted by Abu Kamil (the words are):" Whenever time comes for prayer, pray, for that is a mosque (for you)." (Using translation from Muslim 520a)
قُلْتُ يَا رَسُولَ اللهِ أِيُّ مَسْجِدٍ وُضِعَ فِي الْأَرْضِ أَوَّلًا؟ قَالَ الْمَسْجِدُ الْحَرَامُ قَالَ قُلْتُ ثُمَّ أِيُّ؟ قَالَ ثُمَّ الْمَسْجِدُ الْأَقْصَى قَالَ قُلْتُ كَمْ بَيْنَهُمَا؟ قَالَ أَرْبَعُونَ سَنَةً فَأَيْنَمَا أَدْرَكَتْكَ الصَّلَاةُ فَصَلِّ فَهُوَ مَسْجِدٌ