Hadith 11794

(حديث مرفوع) حَدَّثَنَا يَزِيدُ , وَأَبُو النَّضْرِ , قَالَا : أَخْبَرَنَا عَبْدُ الْعَزِيزِ بْنُ عَبْدِ اللَّهِ بْنِ أَبِي سَلَمَةَ ، عَنْ زَيْدِ بْنِ أَسْلَمَ ، عَنْ عَطَاءِ بْنِ يَسَارٍ ، عَنْ أَبِي سَعِيدٍ الْخُدْرِيِّ ، عَنِ النَّبِيِّ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ ، قَالَ : " إِذَا شَكَّ أَحَدُكُمْ فِي الصَّلَاةِ ، فَلَمْ يَدْرِ ثَلَاثًا صَلَّى أَمْ أَرْبَعًا ، فَلْيَقُمْ ، فَلْيُصَلِّ رَكْعَةً ، قَالَ يَزِيدُ : حَتَّى يَكُونَ الشَّكُّ فِي الزِّيَادَةِ ، ثُمَّ لِيَسْجُدْ سَجْدَتَيْ السَّهْوِ ، فَإِنْ كَانَ صَلَّى خَمْسًا شَفَعَتَا لَهُ صَلَاتَهُ ، وَإِنْ كَانَ صَلَّى أَرْبَعًا فَهُمَا يُرْغِمَانِ الشَّيْطَانَ " .
It is narrated from Hazrat Abu Saeed Khudri (may Allah be pleased with him) that the Prophet (peace and blessings be upon him) said: When any one of you is praying and does not remember how many rak'ahs he has prayed, he should act on what he is certain of, and then while sitting, perform two prostrations of forgetfulness (sujood as-sahw). Because if his prayer was odd, it will become even, and if it was even, it will be a humiliation for Satan.
Hadith Reference مسند احمد / مسند المكثرين من الصحابة / 11794
Hadith Grading حکم دارالسلام: إسناده صحيح، م : 571