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

"The Messenger of Allah (ﷺ) said: 'Whoever has doubt during his prayer, let him prostrate twice after he has said the taslim'".

Comment

Hadith Text & Reference

"The Messenger of Allah (ﷺ) said: 'Whoever has doubt during his prayer, let him prostrate twice after he has said the taslim'".

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

Meaning & Context

This hadith addresses the situation where a worshipper experiences uncertainty (shakk) during prayer regarding the number of rak'ahs performed. The Prophet (ﷺ) prescribed the prostrations of forgetfulness (sujud al-sahw) as a remedy for such doubts that occur in prayer.

The instruction to perform these prostrations "after the taslim" (the concluding salutation) indicates this is the method when doubt arises and the worshipper cannot determine with certainty the correct number of rak'ahs performed.

Scholarly Commentary

Imam an-Nawawi explains that this hadith establishes one of the situations requiring prostrations of forgetfulness - when a person is uncertain about the number of rak'ahs in prayer and cannot reach a conclusive determination.

The scholars differentiate between slight doubt (which should be disregarded) and substantial doubt (which requires correction). This ruling applies when the worshipper cannot confidently determine whether they performed three or four rak'ahs, for instance.

The two prostrations are performed exactly like regular prayer prostrations, with takbir when descending and rising, and the usual supplications. They serve to compensate for potential deficiencies in the prayer due to forgetfulness.

Practical Application

If during your prayer you become uncertain whether you have performed three or four rak'ahs and cannot determine the correct number with confidence, you should complete the prayer based on what you are more certain of (or the lesser number according to some scholars), say the taslim, then immediately perform two prostrations of forgetfulness.

This ruling demonstrates the mercy and practicality of Islamic law, providing a simple means to rectify mistakes made due to human forgetfulness during worship.