أَخْبَرَنَا مُحَمَّدُ بْنُ عَبْدِ اللَّهِ بْنِ عَبْدِ الْحَكَمِ، قَالَ حَدَّثَنَا شُعَيْبٌ، قَالَ أَنْبَأَنَا اللَّيْثُ، عَنْ عُقَيْلٍ، قَالَ حَدَّثَنِي ابْنُ شِهَابٍ، عَنْ سَعِيدٍ، وَأَبِي، سَلَمَةَ وَأَبِي بَكْرِ بْنِ عَبْدِ الرَّحْمَنِ وَابْنِ أَبِي حَثْمَةَ عَنْ أَبِي هُرَيْرَةَ، أَنَّهُ قَالَ لَمْ يَسْجُدْ رَسُولُ اللَّهِ صلى الله عليه وسلم يَوْمَئِذٍ قَبْلَ السَّلاَمِ وَلاَ بَعْدَهُ ‏.‏
Translation
It was narrated from Imran bin Husain that

The Prophet (ﷺ) led them in prayer and forgot (how many rak'ahs he had prayed), then he prostrated twice, then he said the salam.

Comment

The Book of Forgetfulness (In Prayer)

Sunan an-Nasa'i - Hadith 1236

Hadith Text

The Prophet (ﷺ) led them in prayer and forgot (how many rak'ahs he had prayed), then he prostrated twice, then he said the salam.

Commentary

This narration establishes the divine legislation of the Prostration of Forgetfulness (Sujud al-Sahw). When the Prophet, upon him be peace, experienced uncertainty regarding the number of rak'ahs performed, he demonstrated the corrective measure for such an occurrence.

The wisdom behind this practice is to compensate for any potential deficiency in the prayer caused by doubt or forgetfulness. The two prostrations are performed before the final Taslim (salutation), serving as a means of seeking Allah's forgiveness for any inadvertent shortcoming.

This hadith provides immense comfort to the Ummah, illustrating that human oversight during prayer does not invalidate it, but rather has a prescribed rectification. It reflects the mercy and practicality of Islamic law, accommodating human nature while maintaining the prayer's integrity.

Legal Ruling

The majority of scholars hold that performing Sujud al-Sahw is a confirmed Sunnah (Sunnah mu'akkadah) when forgetfulness occurs in prayer. The prostrations are to be made with a single Takbir before descending and after rising, similar to regular prayer prostrations.