It was authentically reported
Ibn Majah and others on the authority of
Abu Humayd or
Abu Usayd (may Allah be pleased with both of them) that the Prophet (peace be upon him) said concerning the Adhkar of entering the Masjid:
When any one of you enters the Masjid, he/she should invoke peace upon the Prophet (peace be upon him) and say: "O Allah! Open for me the doors of Your mercy"; and when he/she steps out, he/she should say: 'O Allah! I seek Your Grace."
The narration of
Muslim does not include the part:
He/she should invoke peace upon the Prophet (peace be upon him).
According to the report of
When he goes out, he should invoke peace upon the Prophet (peace be upon him) and say: O, Allah! I seek refuge with You from the outcast Satan.
This addition is also related by
Abu Hatim and
Ibn Hibban in their Sahih (authentic) Books of Hadith.In this respect, it was also related by
Abu Dawud with a good Sanad (chain of narrators) on the authority of
Haywah ibn Shurayh, that he said, "I met
`Uqbah ibn Muslim and told him that I was informed that you narrated a Hadith on the authority of
`Abdullah ibn `Amr (may Allah be pleased with him), stating:
When the Prophet (peace be upon him) enters (Part No. 24; Page No. 236) the Masjid, he says, 'I seek refuge with Allah the Great, His Noble Face and His Everlasting Authority from the accursed Satan!" `Uqbah asked, 'You only heard that?"
I replied in the affirmative. `Uqbah added, 'When a Muslim says this supplication, Satan announces that he [the Muslim] is protected from him for the rest of the day.'
Abu Dawud with a good Sanad.It is also related on the authority of
Anas (may Allah be pleased with him) and others that
Whenever the Messenger of Allah (peace be upon him) entered the Masjid, he used to say: "In the name of Allah! O Allah! Send Your mercy on Muhammad." Whenever he (peace be upon him) left the Masjid, he used to say: "In the name of Allah! O Allah! Send Your mercy on Muhammad."
Ibn Al-Sunny and it is a reliable report.However, saying "As-Salamu Alaykum" upon entering the Masjid before the prescribed Dhikr (Remembrance of Allah) has no legal foundation in the Purified Shari`ah (Islamic law). What we mentioned above is the supplications that the Shari`ah approved for Muslims to say upon entering the Masjid.May Allah grant us success. May peace and blessings be upon our Prophet Muhammad, his family, and Companions.