Hurayrah that the Messenger of Allah, may Allah bless him and grant him peace, said:
“When one of you stands to pray, Satan comes to him and confuses him until he no longer knows how many units of prayer he has performed. If any of you experiences this, let him perform two prostrations while seated.”
The two Sahīh collections also narrate from him that the Messenger of Allah, may Allah bless him and grant him peace, said:
“When the call to prayer is made, Satan retreats, passing wind so that he cannot hear the call. When the call ends, he returns. When the call is repeated, he retreats; when the repeated call ends, he returns, distracting the worshipper by saying, ‘Remember this; remember that,’ mentioning things he had not been thinking about, until the man no longer knows how many units of prayer he has performed. If any of you does not know how many he has performed, let him perform two prostrations while seated.”
In one wording narrated by al-Bukhārī:
“If any of you does not know how many units of prayer he has performed—three or four—let him perform two prostrations while seated.”
Another wording reads:
“He should perform the two prostrations for forgetfulness.”
This authentic hadith commands the two prostrations for forgetfulness when a person does not know how many units of prayer he has performed. This implies that the prostrations are obligatory, as the majority hold. It also calls them the two prostrations for forgetfulness, indicating that they are prescribed only for forgetfulness, as the majority hold.
His words, “Let him perform two prostrations while seated,” are unrestricted: he did not specify whether they should be performed before or after the concluding salutation. He did, however, command that they be performed before the person gets up. In Sahīh Muslim and elsewhere, Abū Saʿīd al-Khudrī narrated that the Messenger of Allah, may Allah bless him and grant him peace, said:
“If any of you has doubts during his prayer and does not know how many units he has performed, three or four