حَدَّثَنَا أَبُو جَعْفَرٍ مُحَمَّدُ بْنُ سُلَيْمَانَ النُّعْمَانِيُّ ، ثنا الْحُسَيْنُ بْنُ عَبْدِ الرَّحْمَنِ الْجَرْجَرَائِيُّ ، ثنا مُوسَى بْنُ دَاوُدَ ، ثنا سُلَيْمَانُ بْنُ بِلالٍ . ح وَحَدَّثَنَا أَبُو بَكْرٍ النَّيْسَابُورِيُّ ، ثنا الْعَبَّاسُ بْنُ مُحَمَّدٍ ، ثنا مُوسَى بْنُ دَاوُدَ ، ثنا سُلَيْمَانُ بْنُ بِلالٍ ، عَنْ زَيْدِ بْنِ أَسْلَمَ ، عَنْ عَطَاءِ بْنِ يَسَارٍ ، عَنْ أَبِي سَعِيدٍ الْخُدْرِيِّ ، قَالَ : قَالَ رَسُولُ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ : " إِذَا شَكَّ أَحَدُكُمْ فِي صَلاتِهِ فَلَمْ يَدْرِ كَمْ صَلَّى ثَلاثًا أَمْ أَرْبَعًا ، فَلْيَطْرَحِ الشَّكَّ وَلْيَبْنِ عَلَى مَا اسْتَيْقَنَ ، ثُمَّ يَسْجُدُ سَجْدَتَيْنِ قَبْلَ أَنْ يُسَلِّمَ ، فَإِنْ كَانَ صَلَّى خَمْسًا كَانَتَا شَفْعًا لِصَلاتِهِ ، وَإِنْ كَانَ صَلَّى تَمَامَ الأَرْبَعِ كَانَتَا تَرْغِيمًا لِلشَّيْطَانِ " .
Sayyiduna Abu Sa'id Khudri (may Allah be pleased with him) narrates: The Noble Prophet (peace and blessings be upon him) said: "When a person becomes doubtful during prayer and does not know how many rak'ahs he has performed, three or four, then he should put aside the doubt and base it on what he is certain of. Then, before saying the salam, he should perform two prostrations of forgetfulness (sajda sahw). If he has performed five rak'ahs, then the even number among them will be his prayer, and if he has performed four rak'ahs, then these two (prostrations) will be a means of humiliation for Satan."