حَدَّثَنَا أَبُو خَيْثَمَةَ، حَدَّثَنَا إِسْمَاعِيلُ بْنُ إِبْرَاهِيمَ، عَنْ لَيْثِ بْنِ أَبِي سُلَيْمٍ، عَنْ عَبْدِ اللَّهِ بْنِ حَسَنِ بْنِ حَسَنٍ، عَنْ أُمَّهِ فَاطِمَةَ بِنْتِ حُسَيْنٍ، عَنْ جَدَّتِهَا فَاطِمَةَ بِنْتِ رَسُولِ اللَّهِ، قَالَتْ: كَانَ رَسُولُ اللَّهِ صلى الله عليه وسلم إِذَا دَخَلَ الْمَسْجِدَ صَلَّى عَلَى مُحَمَّدٍ، ثُمَّ قَالَ: «اللَّهُمَّ اغْفِرْ لِي ذَنْبِي، وَافْتَحْ لِي أَبْوَابَ رَحْمَتِكَ». وَإِذَا خَرَجَ صَلَّى عَلَى مُحَمَّدٍ، ثُمَّ قَالَ: «اللَّهُمَّ اغْفِرْ لِي ذُنُوبِي، وَافْتَحْ لِي أَبْوَابَ رَحْمَتِكَ» .
It is narrated from Sayyidah Fatimah, the daughter of the Messenger of Allah (may Allah be pleased with her): "When the Messenger of Allah (peace and blessings be upon him) entered the mosque, he would send blessings upon Muhammad (peace and blessings be upon him) and then supplicate thus: 'Allahummaghfir li dhanbi, waftah li abwaba rahmatik' (O Allah, forgive me my sin and open for me the doors of Your mercy). And when he (peace and blessings be upon him) came out of the mosque, he would send blessings upon Muhammad (peace and blessings be upon him) and then recite this supplication: 'Allahummaghfir li dhunubi, waftah li abwaba rahmatik' (O Allah, forgive me my sins and open for me the doors of Your mercy)."