The Messenger of Allah ﷺ said, "A prayer in my mosque is better than a thousand prayers in any other mosque, except the Sacred Mosque, and a prayer in the Sacred Mosque is better than a hundred thousand prayers in any other mosque."
حدثنا إسمعيل بن أسد حدثنا زكريا بن عدي أنبأنا عبيد الله بن عمرو عن عبد الكريم عن عطاء
أن رسول الله ﷺ قال صلاة في مسجدي أفضل من ألف صلاة فيما سواه إلا المسجد الحرام وصلاة في المسجد الحرام أفضل من مائة ألف صلاة فيما سواه
[Its chain of transmission is sahih] Ahmad related it, 3/343, 397, from the hadith of Ubaydullah bin Amr Raqqi, through this same route. Busiri and Ibn Abdul-Hadi in al-Tanqih, among others, graded it sahih.