عَنْ أَبِي سَعِيدٍ الْخُدْرِيِّ رضي الله عنه قَالَ: قَالَ رَسُولُ اللهِ صَلَّى اللهُ عَلَيْهِ وَسَلَّمَ:
«إِذَا شَكَّ أَحَدُكُمْ فِي صَلَاتِهِ، فَلَمْ يَدْرِ كَمْ صَلَّى ثَلَاثًا أَمْ أَرْبَعًا، فَلْيَطْرَحِ الشَّكَّ، وَلْيَبْنِ عَلَى مَا اسْتَيْقَنَ، ثُمَّ يَسْجُدُ سَجْدَتَيْنِ قَبْلَ أَنْ يُسَلِّمَ، فَإِنْ كَانَ صَلَّى خَمْسًا شَفَعْنَ لَهُ صَلَاتَهُ، وَإِنْ كَانَ صَلَّى إِتْمَامًا لِأَرْبَعٍ كَانَتَا تَرْغِيمًا لِلشَّيْطَانِ».
[صحيح] - [رواه مسلم] - [صحيح مسلم: 571]
المزيــد ...
Abu Sa‘īd al-Khudri (may Allah be pleased with him) reported: The Messenger of Allah (may Allah's peace and blessings be upon him) said:
"When anyone of you is in doubt about his prayer, not knowing how much he prayed, three or four, let him dispel the doubt and build upon what he is certain about, then perform two prostrations before making Taslīm. If he has prayed five, they will make his prayer even-numbered, and if he has prayed exactly four, they will be humiliation for the devil."
[Authentic hadith] - [Narrated by Muslim] - [Sahih Muslim - 571]
The Prophet (may Allah's peace and blessings be upon him) clarified that if the person praying is in doubt about his prayer, not knowing how much he prayed, three or four, let him exclude the extra number that he doubts and not take it into account, so three is the number he is certain about, and let him perform a fourth Rak'ah, then offer two prostrations before making Taslīm (salutation of peace ending the prayer).
If he has actually offered four Rak‘ahs, they will become five by adding a Rak‘ah, and the two prostrations of forgetfulness stand for one Rak‘ah, so the total will be even, not odd. On the other hand, if he has prayed four in total with the extra Rak‘ah, then he has performed what is due on him without any increase or decrease.
In this case, the two prostrations of forgetfulness will bring humiliation and defeat to the devil and will drive him away from fulfilling his goal because he threw him into confusion regarding his prayer and tried to spoil it. However, man's prayer became complete when he obeyed Allah Almighty through prostration, which was the same act through which Satan disobeyed Allah when he refused to obey Him by prostrating to Adam.