صحیح ابن حبان
Ibn Hibban
كتاب الصلاة
Book of Prayer
باب سجود السهو - ذكر البيان بأن الباني على الأقل في صلاته عند شكه عليه أن يسجد سجدتي السهو قبل السلام لا بعده
Chapter on Prostration of Forgetfulness - Clarification that one who builds on the lesser number in prayer when in doubt should prostrate before salam, not after
1 hadith
Hadith 2663
Sayyiduna Abu Sa'id Khudri (may Allah be pleased with him) narrates this statement of the Noble Prophet (peace and blessings of Allah be upon him): "When a person performs prayer and does not know whether he has performed three rak'ahs or four rak'ahs, then he should perform one more rak'ah and before saying the salam, he should perform the prostration of forgetfulness (sajdah sahw) twice. If he had performed three rak'ahs, then these two prostrations will make them even, and if he had performed four, then these two prostrations will disgrace Satan." (Imam Ibn Hibban, may Allah have mercy on him, says:) This narration has been transmitted by Imam Ahmad ibn Hanbal from Safwan bin Salih.