حَدَّثَنَا عَبْدُ الصَّمَدِ بْنُ عَلِيٍّ الْمَكْرَمِيُّ ، ثنا إِبْرَاهِيمُ بْنُ أَحْمَدَ بْنِ مَرْوَانَ ، ثنا مُحَمَّدُ بْنُ أَبَانَ ، حَدَّثَنَا فُلَيْحُ بْنُ سُلَيْمَانَ ، عَنْ زَيْدِ بْنِ أَسْلَمَ ، عَنْ عَطَاءِ بْنِ يَسَارٍ ، عَنْ أَبِي سَعِيدٍ الْخُدْرِيِّ ، قَالَ : قَالَ رَسُولُ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ : " إِذَا صَلَّى أَحَدُكُمْ فَلَمْ يَدْرِ أَثْلاثًا صَلَّى أَمْ أَرْبَعًا فَلْيُتِمَّ حَتَّى يَسْتَيْقِنَ أَنَّهُ قَدْ أَتَمَّ ، ثُمَّ يَسْجُدُ سَجْدَتَيْنِ قَبْلَ السَّلامِ ، فَإِنْ كَانَتْ صَلاتُهُ وِتْرًا كَانَتْ شَفْعًا لِصَلاتِهِ ، وَإِنْ كَانَتْ صَلاتُهُ شَفْعًا كَانَتْ تَرْغِيمًا لِلشَّيْطَانِ " .
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 performs prayer and is unsure whether he has prayed three rak'ahs or four, he should complete it until he is certain that he has completed the prayer. Then, before saying the final salam, he should perform two prostrations of forgetfulness (sajda sahw). If his prayer was odd, these (prostrations) will make it even, and if his prayer was already even, then these prostrations will be a means of humiliating Satan."