Abdur-Rahman bin Abu Saeed Khudri passed by me, and I asked him, "How did you hear your father describe the mosque founded on piety?"He replied, "My father said, 'I went to see the Messenger of Allah ﷺ in the house of one of his wives and asked, "Messenger of Allah, which of the two mosques is the one founded on piety?" He took a handful of pebbles, struck the ground with them, and said, "It is this mosque of yours," meaning the mosque of Madinah.'"I said, "I bear witness that I heard your father describe it just like that."
مر بي عبد الرحمن بن أبي سعيد الخدري قال: قلت له: كيف سمعت أباك يذكر في المسجد الذي أسس على التقوى؟ قال: قال أبي: دخلت على رسول الله ﷺ في بيت بعض نسائه. فقلت: يا رسول الله! أي المسجدين الذي أسس على التقوى؟ قال: فأخذ كفا من حصباء فضرب به الأرض. ثم قال: هو مسجدكم هذا لمسجد المدينة. قال: فقلت: أشهد أني سمعت أباك هكذا يذكره.
Muslim narrated it in Hajj (1398) from Muhammad bin Hatim, who said, Yahya bin Saeed narrated to us, from Humayd Kharrat, who said, "I heard Abu Salama bin Abdul-Rahman," and he mentioned it.Tirmidhi (3099) and Nasai (697) narrated it through another route from Imran bin Abu Anas, from Abdul-Rahman bin Abu Saeed, from Abu Saeed Khudri, that he said, "Two men disputed about the masjid that was founded upon piety from the first day. One man said, 'It is the masjid of Quba,' and the other said, 'It is the masjid of the Messenger of Allah ﷺ.'" The Messenger of Allah ﷺ said, "It is this masjid of mine."Tirmidhi said, "Hasan sahih gharib, from the hadith of Imran bin Abu Anas. This has also been narrated from Abu Saeed through a route other than this one, and Anis bin Abu Yahya narrated it from his father, from Abu Saeed."I say, the hadith of Anis bin Abu Yahya was narrated by Tirmidhi (323) from Qutayba, who said, Hatim bin Ismail narrated to us, from Anis bin Abu Yahya with the same chain, and in it, a man from Banu Khudra and a man from Banu Amr bin Awf disputed about the masjid that was founded upon piety. The Khudri man said, "It is the masjid of the Messenger of Allah ﷺ," and the other said, "It is the masjid of Quba." So the two of them came to the Messenger of Allah ﷺ about that, and he said, "It is this one," meaning his masjid, "and in that there is much good."Tirmidhi said, "Hasan sahih."Ibn Hajar, in Fath al-Bari (7/245), favored the view that both of them were founded upon piety, and mention of this will come in detail in the book of tafsir.