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 enters the mosque, he should send salutations upon the Prophet (peace and blessings be upon him) and recite this supplication: « اللَّهُمَّ افْتَحْ لِي أَبْوَابَ رَحْمَتِكَ » 'O Allah, open for me the doors of Your mercy.' And when he leaves the mosque, he should send salutations upon the Prophet (peace and blessings be upon him) and also recite this supplication: « اللَٰهُمَّ أَجِرنِي مِنَ الشَّيْطَانِ الرَّجِيمِ » 'O Allah, protect me from the accursed devil.'"