A prayer in the mosque of the Messenger of Allah ﷺ is better than a thousand prayers in any other mosque except the Sacred Mosque, for the Messenger of Allah ﷺ is the last of the prophets and his mosque is the last of the mosques.Abu Salama and Abu Abdullah said, "We had no doubt that Abu Hurairah was reporting from a hadith of the Messenger of Allah ﷺ, so this kept us from asking Abu Hurairah to confirm the source of that hadith. Then when Abu Hurairah died, we recalled the matter and blamed one another for not having spoken to Abu Hurairah about it so that he might trace it back to the Messenger of Allah ﷺ, if indeed he had heard it from him. While we were in this state, Abdullah bin Ibrahim bin Qariz sat with us, so we mentioned that hadith and how we had failed to obtain explicit confirmation from Abu Hurairah."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 it is the last of the mosques.'"
أخبرنا كثير بن عبيد قال حدثنا محمد بن حرب عن الزبيدي عن الزهري عن أبي سلمة بن عبد الرحمن وأبي عبد الله الأغر مولى الجهنيين وكانا من أصحاب أبي هريرة أنهما سمعا
صواو في مسجد رسول الله ﷺ أفضل من ألف صلاة فيما سواه من المساجد إلا المسجد الحرام فإن رسول الله ﷺ آخر الأنبياء ومسجده آخر المساجد قال أبو سلمة وأبو عبد الله لم نشك أن أبا هريرة كان يقول عن حديث رسول الله ﷺ فمنعنا أن نستثبت أبا هريرة في ذلك الحديث حتى إذا توفي أبو هريرة ذكرنا ذلك وتلاومنا أن لا نكون كلمنا أبا هريرة في ذلك حتى يسنده إلى رسول الله ﷺ إن كان سمعه منه فبينا نحن على ذلك جالسنا عبد الله بن إبراهيم بن قارظ فذكرنا ذلك الحديث والذي فرطنا فيه من نص أبي هريرة فقال لنا عبد الله بن إبراهيم أشهد أني سمعت أبا هريرة يقول قال رسول الله ﷺ فإني آخر الأنبياء وإنه آخر المساجد
Muslim recorded it in the Hajj chapter, in the section on the merit of prayer in the two masjids of Makkah and Madinah, hadith number 507/1394, from the hadith of Muhammad bin Harb, and Bukhari recorded it in the chapter on the merit of prayer in the masjid of Makkah and Madinah, in the section on the merit of prayer in the masjid of Makkah and Madinah, hadith number 1190, from the hadith of Aghar through the same chain, and it is also in Kubra, hadith number 773, though Bukhari's wording is abridged.