The Messenger of Allah ﷺ said, "I am the last of the prophets, and my mosque is the last of the mosques."
قال رسول الله ﷺ: فإني آخر الأنبياء، وإن مسجدي آخر المساجد.
Muslim narrated it in his chapter on Hajj (1394), from Ishaq bin Mansur, who said, Isa bin Mundhir Himsi told us, Muhammad bin Harb told us, Zubaydi told us, from Zuhri, from Abu Salama bin Abdul-Rahman and Abu Abdullah Aghar, the freedman of the Juhaynis, who was one of the companions of Abu Hurairah, that both of them heard Abu Hurairah say, "A prayer in the masjid of the Messenger of Allah ﷺ is better than a thousand prayers in any other masjid, except Masjid al-Haram, for the Messenger of Allah ﷺ is the last of the prophets, and his masjid is the last of the masjids."Abu Salama and Abu Abdullah said, We had no doubt that Abu Hurairah was reporting this as a hadith from the Messenger of Allah ﷺ. But this kept us from verifying with Abu Hurairah about that hadith, until Abu Hurairah passed away, and then we discussed it together. We blamed ourselves for not having spoken to Abu Hurairah about it so that he could trace it back explicitly to the Messenger of Allah ﷺ, if indeed he had heard it from him.While we were in this state, we sat with Abdullah bin Ibrahim bin Qariz, and we mentioned that hadith to him, along with what we had neglected regarding the explicit wording of Abu Hurairah about it. Abdullah bin Ibrahim said to us, I bear witness that I heard Abu Hurairah say, the Messenger of Allah ﷺ said, "For I am the last of the prophets, and my masjid is the last of the masjids."His saying, "My masjid is the last of the masjids," means the last of the masjids of the prophets in terms of establishment and construction, since no prophet will come after him to establish a new masjid.