The Messenger of Allah ﷺ said, "A prayer in my mosque is better than a thousand prayers anywhere else except the Sacred Mosque, and a prayer in the Sacred Mosque is better than a hundred thousand prayers anywhere else."
أن رسول الله ﷺ قال: صلاة في مسجدي أفضل من ألف صلاة فيما سواه إلا المسجد الحرام، وصلاة في المسجد الحرام أفضل من مائة ألف صلاة فيما سواه.
Ibn Majah (1406) and Imam Ahmad (14694) both narrated it through routes from Ubaydullah bin Amr, from Abdul-Kareem, from Ata, from Jabir, who related it. Its chain of transmission is sahih. Abdul-Kareem is Ibn Malik Jazari. Busiri said in Zawaid bin Majah, its chain of transmission is sahih. For more, see the Book of Masjids.Ata bin Abu Rabah was asked, "Is this merit that you mention specific to Masjid al-Haram alone, or does it apply to the whole sacred precinct?" He said, "No, rather it applies to the whole sacred precinct, for the entire sacred precinct is a masjid." Abu Dawud Tayalisi mentioned this in his Musnad (1364).The following hadith supports what Ata bin Abu Rabah said.