أَخْبَرَنَا مُحَمَّدُ بْنُ رَافِعٍ، قَالَ حَدَّثَنَا يَحْيَى بْنُ آدَمَ، قَالَ حَدَّثَنَا مُفَضَّلٌ، - وَهُوَ ابْنُ مُهَلْهَلٍ - عَنْ مَنْصُورٍ، عَنْ إِبْرَاهِيمَ، عَنْ عَلْقَمَةَ، عَنْ عَبْدِ اللَّهِ، يَرْفَعُهُ إِلَى النَّبِيِّ صلى الله عليه وسلم قَالَ ‏"‏ إِذَا شَكَّ أَحَدُكُمْ فِي صَلاَتِهِ فَلْيَتَحَرَّ الَّذِي يَرَى أَنَّهُ الصَّوَابُ فَيُتِمَّهُ ثُمَّ - يَعْنِي - يَسْجُدُ سَجْدَتَيْنِ ‏"‏ ‏.‏ وَلَمْ أَفْهَمْ بَعْضَ حُرُوفِهِ كَمَا أَرَدْتُ ‏.‏
Translation
It was narrated from Abu Hurairah that

The Messenger of Allah (ﷺ) said: "When any one of you gets up and prays, the Shaitan comes to him an confuses him until he does not know how many (Rak'ahs) he prayed. If any one of you notices that, let him prostrate twice when he is sitting."

Comment

Hadith Text & Reference

The Messenger of Allah (ﷺ) said: "When any one of you gets up and prays, the Shaitan comes to him and confuses him until he does not know how many (Rak'ahs) he prayed. If any one of you notices that, let him prostrate twice when he is sitting."

Source: Sunan an-Nasa'i 1252 | Book: The Book of Forgetfulness (In Prayer)

Commentary on the Hadith

This noble hadith addresses the common occurrence of doubt and forgetfulness (sahw) during prayer, which is a trial from Shaytan. The Prophet (ﷺ) acknowledges this human reality and provides a clear, divinely-guided remedy.

The phrase "the Shaitan comes to him and confuses him" indicates that such confusion is not from one's own deficiency in faith, but rather an external whisper (waswas) that even the most devout may experience. This should bring comfort to the worshipper and prevent self-doubt.

The prescribed solution - "prostrate twice when he is sitting" - refers to the prostrations of forgetfulness (sujūd al-sahw). These two prostrations are performed before the final tasleem (salutation) if the doubt occurs after having completed part of the prayer. This act serves to rectify any potential shortcomings in the prayer caused by the confusion.

Scholars explain that when in doubt about the number of rak'ahs performed, one should base their action on what they are certain of (yaqīn) and then perform the prostrations of forgetfulness. This hadith establishes that these prostrations are a complete remedy for doubts introduced by Shaytan during prayer.

Legal Rulings Derived

1. The prostrations of forgetfulness are a confirmed Sunnah (mu'akkadah) when doubt occurs in prayer.

2. The worshipper should continue based on what they are most certain of regarding the number of rak'ahs completed.

3. These prostrations are performed before the final tasleem in cases of doubt about the number of units prayed.

4. The occurrence of such doubts does not invalidate the prayer when the prescribed remedy is applied.

Spiritual Lessons

Allah in His mercy has made the religion easy and has provided solutions for human shortcomings. The existence of sujud al-sahw demonstrates the compassionate nature of Islamic legislation.

This teaching encourages persistence in worship despite distractions and difficulties, knowing that complete perfection is only for Allah. The believer should not abandon prayer due to occasional confusion but should implement the prescribed correction.

The hadith also teaches us about the reality of spiritual warfare - that Shaytan actively tries to disrupt our worship, and we must be prepared with the weapons Allah has given us through His Messenger.