حَدَّثَنَا أَبُو بَكْرٍ النَّيْسَابُورِيُّ ، ثنا يُونُسُ بْنُ عَبْدِ الأَعْلَى ، حَدَّثَنَا ابْنُ وَهْبٍ ، أَخْبَرَنِي هِشَامُ بْنُ سَعْدٍ ، أَنَّ زَيْدَ بْنَ أَسْلَمَ ، حَدَّثَهُمْ ، عَنْ عَطَاءِ بْنِ يَسَارٍ ، عَنْ أَبِي سَعِيدٍ الْخُدْرِيِّ ، أَنَّ رَسُولَ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ ، قَالَ : " إِذَا شَكَّ أَحَدُكُمْ فِي صَلاتِهِ فَلَمْ يَدْرِ صَلَّى ثَلاثًا أَمْ أَرْبَعًا فَلْيَقُمْ فَلْيُصَلِّ رَكْعَةً ، ثُمَّ لِيَسْجُدْ سَجْدَتَيْنِ وَهُوَ جَالِسٌ قَبْلَ التَّسْلِيمِ ، فَإِنْ كَانَتِ الرَّكْعَةُ الَّتِي صَلَّى خَامِسَةً شَفَعَهَا بِهَاتَيْنِ السَّجْدَتَيْنِ ، وَإِنْ كَانَتْ رَابِعَةً فَالسَّجْدَتَانِ تَرْغِيمٌ لِلشَّيْطَانِ " .
Sayyiduna Abu Sa'id Khudri (may Allah be pleased with him) narrates: The Noble Prophet (peace and blessings be upon him) said: "If someone is in doubt during prayer and does not know whether he has performed three rak'ahs or four, then he should stand up and perform another rak'ah, and then, while he is sitting, before saying the salam, he should perform two prostrations of forgetfulness (sajda sahw). If the rak'ah he performed was the fifth, then these two prostrations will make it even, and if it was the fourth, then these two prostrations will disgrace the nose of Satan."