صحيح ابن خزيمه
Sahih Ibn Khuzaymah
جماع أَبْوَابِ ذِكْرِ أَفْعَالٍ اخْتَلَفَ النَّاسُ فِي إِبَاحَتِهِ لِلْمُحْرِمِ، نَصَّتْ سُنَّةُ النَّبِيِّ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ أَوْ دَلَّتْ عَلَى إِبَاحَتِهَا
Chapters on Acts Permitted for the Pilgrim by Sunnah
(160) بَابُ الدُّعَاءِ عِنْدَ دُخُولِ الْمَسْجِدِ
Chapter: Supplication upon entering the mosque
Hadith Number: 2706
حدثنا محمد بن بشار ، حدثنا ابو بكر يعني الحنفي ، حدثنا الضحاك بن عثمان ، حدثني سعيد المقبري ، عن ابي هريرة ، ان رسول الله صلى الله عليه وسلم، قال: " إذا دخل احدكم المسجد، فليسلم على النبي وليقل: اللهم افتح لي ابواب رحمتك، وإذا خرج فليسلم على النبي، وليقل: اللهم اجرني من الشيطان الرجيم"
It is narrated from Sayyiduna Abu Hurairah (may Allah be pleased with him) that the Messenger of Allah (peace and blessings be upon him) said: "When any one of you is about to enter the mosque, he should send salutations upon the Noble Prophet (peace and blessings be upon him) and recite this supplication «اللّهُـمَّ افْتَـحْ لي أَبْوابَ رَحْمَتـِك» 'O Allah, open for me the doors of Your mercy.' And when he is about to leave the mosque, he should send blessings and salutations upon the Noble Prophet (peace and blessings be upon him) and recite this supplication « اللَّهُمَّ أَجِرْنِيْ مِنَ الشَّيْطَانِ الرَّجِيمِ» 'O Allah, protect me from the accursed devil.'"
تخریج الحدیث: