What he said walking in, and what changed on the way out
One word is different between the two.
رَبِّ اغْفِرْ لِي ذُنُوبِي وَافْتَحْ لِي أَبْوَابَ رَحْمَتِكَ
Rabbi-ghfir lī dhunūbī wa-ftaḥ lī abwāba raḥmatik
“My Lord, forgive me my sins and open for me the doors of Your mercy.”
On leaving, say faḍlik in place of raḥmatik.
Where this comes from
Fatimah reports both halves. Going in he sent peace on the Prophet and asked for the doors of mercy. Coming out he sent peace again and asked for the doors of bounty. Mercy is what you go in for. Provision is what you go back out into.
The full narration
Fatimah the Great narrated:"When Allah's Messenger entered the Masjid he said Salat and Salam upon Muhammad and then said: (Rabbighfirli dhunubi, waftahli abwaba rahmatik) 'O pardon my sins, and open the gates of Your mercy for me.' And when he exited he said Salat and Salam upon Muhammad, and then said: (Rabbighfirli dunubi, waftahli abwaba rakmatik) 'O Lord pardon my sins, and open the gates of Your blessings for me
Source
Jāmiʿ at-Tirmidhī · 314
- Ahmad Muhammad Shakir: Sahih
- Al-Albani: Sahih
- Zubair Ali Zai: Daif
Note on the chain. Scholars differ on this chain. Zubair Ali Zai grades it Daif. The majority (2 of 3) authenticate it.
Read it at the source ↗