It is narrated from the Companions of the Messenger of Allah (peace and blessings be upon him) (may Allah be pleased with them) that they said: "Indeed the mosques are the houses of Allah Almighty on the earth."
This chain is mawquf (stopping at the Companions), and all its narrators are thiqat (trustworthy).
Hadith Referenceإتحاف الخيرة المهرة بزوائد المسانيد العشرة / كتاب المساجد / 968
It is narrated from Sayyiduna Ibn Umar (may Allah be pleased with them both) that a man came to the Messenger of Allah (peace and blessings be upon him) and said: "O Messenger of Allah (peace and blessings be upon him)! Which places are the best?" He (peace and blessings be upon him) said: "I do not know," or he (peace and blessings be upon him) remained silent. Then the man asked: "Which places are the worst?" He (peace and blessings be upon him) said: "I do not know," or he (peace and blessings be upon him) remained silent. Then Jibril (peace be upon him) came to him (peace and blessings be upon him), and he (peace and blessings be upon him) asked him the same question; he too said: "I do not know." He (peace and blessings be upon him) said: "Ask your Lord." Jibril (peace be upon him) said: "We do not ask Allah Almighty about anything (of our own accord, out of awe of His majesty)," and he trembled so violently that Muhammad (peace and blessings be upon him) almost fainted (from the awe of his trembling). Then, when Jibril (peace be upon him) ascended, Allah, the Mighty and Majestic, said: "Muhammad (peace and blessings be upon him) asked you which places are the best, and you said, 'I do not know'?" He said: "Yes (O Lord)." Allah Almighty said: "Tell him that the best places are the mosques and the worst places are the markets."
I (al-Busiri) say: Ibn Hibban recorded it in his Sahih, al-Bayhaqi in his Sunan and al-Tabarani in al-Kabir, through Jarir bin Abd al-Hamid from Ata bin al-Sa'ib (may Allah have mercy on him). Judging it sahih (authentic) is open to question, because Jarir bin Abd al-Hamid heard from Ata (may Allah have mercy on him) after his ikhtilat (deterioration of memory); this was stated by Imam Ahmad bin Hanbal (may Allah have mercy on him) and his teacher Yahya bin Sa'id al-Qattan (may Allah have mercy on him), as I have explained in 'Tabyin Hal al-Mukhtalitin'. However, it has a shahid (supporting narration) from the hadith of Sayyiduna Abu Hurayrah (may Allah be pleased with him), which Imam Muslim recorded in his Sahih: "The most beloved parts of towns to Allah are the mosques, and the most hated parts of towns to Allah are the markets." Imam Ahmad bin Hanbal (may Allah have mercy on him) also recorded it in his Musnad from the hadith of Sayyiduna Jubayr bin Mut'im (may Allah be pleased with him), and this narration will come later in 'Kitab al-Buyu'' (the Book of Sales).
Hadith Referenceإتحاف الخيرة المهرة بزوائد المسانيد العشرة / كتاب المساجد / 969
Hadith Gradingمحدثین:إسناده ضعيف؛ لأن جريرًا سمع من عطاء بن السائب بعد الاختلاط، والمتن صحيح من حديث أبي هريرة