A man from Banu Khudrah and a man from Banu Amr bin Awf disputed about the mosque founded upon piety.The Khudri said, "It is the mosque of the Messenger of Allah ﷺ."The other said, "It is the mosque of Quba."So they came to the Messenger of Allah ﷺ about that, and he said, "It is this one," meaning his own mosque, "and in that there is much good."
حدثنا قتيبة حدثنا حاتم بن إسمعيل عن أنيس بن أبي يحيى عن أبيه
امترى رجل من بني خدرة ورجل من بني عمرو بن عوف في المسجد الذي أسس على التقوى فقال الخدري هو مسجد رسول الله ﷺ وقال الآخر هو مسجد قباء فأتيا رسول الله ﷺ في ذلك فقال هو هذا يعني مسجده وفي ذلك خير كثير
[Sahih]. Ahmad reported it: 23/3, 91, from the hadith of Anis through this route, and its isnad is hasan. He also graded it sahih at 23/3. Ibn Hibban (Al-Ihsan): 1624, and Hakim: 487/1, according to the criterion of Muslim, and Dhahabi agreed with him. Muslim also reported it through another route from Abu Saeed Khudri, as will come at 3099.The statement of Yahya Qattan about Anis and his brother is sahih and firmly established from him.