Hadithcore
Sahih Muslim, 713 a
sahih

Abu Usaid reported that the Messenger of Allah (ﷺ) said:

When any one of you enters the mosque, he should say:" O Allah! open for me the doors of Your mercy" ; and when he steps out he should say: 'O Allah! I beg of You Your Grace." (Imam Muslim said: I heard Yahya saying: I transcribed this hadith from the compilation of Sulaiman b. Bilal.)

حَدَّثَنَا يَحْيَى بْنُ يَحْيَى، أَخْبَرَنَا سُلَيْمَانُ بْنُ بِلاَلٍ، عَنْ رَبِيعَةَ بْنِ أَبِي عَبْدِ الرَّحْمَنِ، عَنْ عَبْدِ الْمَلِكِ بْنِ سَعِيدٍ، عَنْ أَبِي حُمَيْدٍ، - أَوْ عَنْ أَبِي أُسَيْدٍ، - قَالَ قَالَ رَسُولُ اللَّهِ صلى الله عليه وسلم ‏

‏ إِذَا دَخَلَ أَحَدُكُمُ الْمَسْجِدَ فَلْيَقُلِ اللَّهُمَّ افْتَحْ لِي أَبْوَابَ رَحْمَتِكَ ‏.‏ وَإِذَا خَرَجَ فَلْيَقُلِ اللَّهُمَّ إِنِّي أَسْأَلُكَ مِنْ فَضْلِكَ ‏

‏ ‏.‏ قَالَ مُسْلِمٌ سَمِعْتُ يَحْيَى بْنَ يَحْيَى يَقُولُ كَتَبْتُ هَذَا الْحَدِيثَ مِنْ كِتَابِ سُلَيْمَانَ بْنِ بِلاَلٍ ‏.‏ قَالَ بَلَغَنِي أَنَّ يَحْيَى الْحِمَّانِيَّ يَقُولُ وَأَبِي أُسَيْدٍ ‏.‏

References2 variants
In-Book Reference
Book 6, Hadith 82
USC-MSA web (English) reference
Book 4, Hadith 1538 (deprecated numbering scheme)
Sharh · explanationclick to expand
Mosques are the houses of Allah Almighty. They are held sacred in the hearts of the believers, and they are the place where prayers, individual and congregational, are performed, dhikr is observed, and Allah bestows His favor upon His servants by giving them great rewards. This Hadīth addresses two of the etiquettes related to the mosque, to which the Prophet (may Allah's peace and blessings be upon him) gave direction. First: An etiquette related to entering the mosque. The Prophet (may Allah's peace and blessings be upon him) said: "When anyone of you enters the mosque," i.e., wants to enter it, when he arrives at its door, "let him say: O Allah, open for me the gates of Your mercy," which encompasses everything. This is an invocation to Allah to cover him with His vast mercy and enable him to perform the righteous deeds that will be a reason for entering through numerous gates of mercy. Second: An etiquette related to leaving the mosque. He said: "And when he leaves, let him say, O Allah, I ask You from Your bounty" from Your lawful sustenance. This is an invocation to Allah and an acknowledgment that He is the Bestower of great favor upon His servants, the Provider, and the One Who gives out of His vast bounty without limit. It was said: The reason for mentioning mercy with entering and bounty with leaving is that mercy in the Book of Allah is intended for the blessings related to people's souls and the Hereafter. Allah Almighty says: {But the mercy of your Lord is better than what they accumulate.} [Surat az-Zukhruf: 32] Whereas bounty is intended for worldly blessings. Allah Almighty says: {There is no blame upon you for seeking the bounty of your Lord [by trading].} [Surat al-Baqarah: 198] Allah Almighty also says: {When the prayer is over, disperse in the land and seek from the bounty of Allah.} [Surat al-Jumu‘ah: 10] When a person enters the mosque, he seeks closeness to Allah and engages in deeds that bring him near Allah's rewards and Paradise; so, the mention of mercy suits that. And when he leaves the mosque, he seeks sustenance; so, the mention of bounty suits that. The supplications reported in such situations are intended for giving guidance and taking into account occasions, and they aim at connecting the servant to his Lord in all his conditions and activities, and reminding that Allah Almighty has power over all things and that He likes that His servants ask of Him. Allah Almighty says: {Your Lord says: "Call upon Me; I will respond to you."} [Surat Ghāfir: 60] In the Hadīth: Urging remembrance of Allah upon entering the mosque and upon leaving it..
Related hadiths4
Compare isnād across 4 related chains →