Caution: Translations of Quran and Ḥadīth may lead to possible misapplications and misinterpretations. This site is intended for students of sacred knowledge that are proficient in comprehending classical Arabic and have a strong foundation in Islamic sciences. Also note that religious injunctions rely on several aspects beyond what one may glean through reading individual aḥādīth.
bayhaqi:3803Abū Muḥammad ʿAbdullāh b. Yūsuf al-Aṣbahānī Imlāʾ > al-Shaykh Abū Bakr Aḥmad b. Isḥāq > al-Ḥasan b. ʿAlī b. Ziyād > Saʿīd b. Sulaymān > ʿAbd al-ʿAzīz b. Abū Salamah > Zayd b. Aslam > ʿAṭāʾ b. Yasār > Abū Saʿīd al-Khudrī

[Machine] The Messenger of Allah ﷺ said, "If one of you is unsure whether he has prayed three or four (rak'ahs), then he should complete it and perform one more rak'ah, then make two prostrations of forgetfulness while sitting. If his prayer was five (rak'ahs), then the extra rak'ah is a voluntary prayer, and if it was four (rak'ahs), then they are a means of thwarting Satan, and this is their meaning."  

البيهقي:٣٨٠٣حَدَّثَنَا أَبُو مُحَمَّدٍ عَبْدُ اللهِ بْنُ يُوسُفَ الْأَصْبَهَانِيُّ إِمْلَاءً ثنا الشَّيْخُ أَبُو بَكْرٍ أَحْمَدُ بْنُ إِسْحَاقَ أنبأ الْحَسَنُ بْنُ عَلِيِّ بْنِ زِيَادٍ ثنا سَعِيدُ بْنُ سُلَيْمَانَ ثنا عَبْدُ الْعَزِيزِ بْنُ أَبِي سَلَمَةَ ثنا زَيْدُ بْنُ أَسْلَمَ عَنْ عَطَاءِ بْنِ يَسَارٍ عَنْ أَبِي سَعِيدٍ الْخُدْرِيِّ قَالَ

قَالَ رَسُولُ اللهِ ﷺ إِذَا لَمْ يَدْرِ أَحَدُكُمْ ثَلَاثًا صَلَّى أَمْ أَرْبَعًا؟ فَلْيُتِمَّ وَيُصَلِّي رَكْعَةً ثُمَّ يَسْجُدْ بَعْدَ ذَلِكَ سَجْدَتَيِ السَّهْوِ وَهُوَ جَالِسٌ فَإِنْ كَانَتْ صَلَاتُهُ خَمْسًا شَفَعَتْ صَلَاتَهُ وَإِنْ كَانَتْ أَرْبَعًا كَانَتَا تَرْغِيمًا لِلشَّيْطَانِ وَبِمَعْنَاهُ  

رَوَاهُ مُحَمَّدُ بْنُ عَجْلَانَ وَفُلَيْحُ بْنُ سُلَيْمَانَ وَمُحَمَّدُ بْنُ مُطَرِّفٍ عَنْ زَيْدِ بْنِ أَسْلَمَ مَوْصُولًا

See similar narrations below:

Collected by Nasāʾī, Mālik, Dārimī, Nasāʾī's Kubrá, Bayhaqī
nasai:1239Muḥammad b. Rāfiʿ > Ḥujayn b. al-Muthanná > ʿAbd al-ʿAzīz / Ibn Abū Salamah > Zayd b. Aslam > ʿAṭāʾ b. Yasār > Abū Saʿīd al-Khudrī

The Prophet ﷺ said: "If one of you does not know whether he prayed three or four (rak'ahs), let him pray a rak'ah then prostrate twice after that when he is sitting. Then if he prayed five (rak'ahs), they (the two prostrations) will make his prayer even-numbered, and if he had prayed four, they will annoy and humiliate the shaitan."  

النسائي:١٢٣٩أَخْبَرَنَا مُحَمَّدُ بْنُ رَافِعٍ قَالَ حَدَّثَنَا حُجَيْنُ بْنُ الْمُثَنَّى قَالَ حَدَّثَنَا عَبْدُ الْعَزِيزِ وَهُوَ ابْنُ أَبِي سَلَمَةَ عَنْ زَيْدِ بْنِ أَسْلَمَ عَنْ عَطَاءِ بْنِ يَسَارٍ عَنْ أَبِي سَعِيدٍ الْخُدْرِيِّ

عَنِ النَّبِيِّ ﷺ قَالَ إِذَا لَمْ يَدْرِ أَحَدُكُمْ صَلَّى ثَلاَثًا أَمْ أَرْبَعًا فَلْيُصَلِّ رَكْعَةً ثُمَّ يَسْجُدْ بَعْدَ ذَلِكَ سَجْدَتَيْنِ وَهُوَ جَالِسٌ فَإِنْ كَانَ صَلَّى خَمْسًا شَفَعَتَا لَهُ صَلاَتَهُ وَإِنْ صَلَّى أَرْبَعًا كَانَتَا تَرْغِيمًا لِلشَّيْطَانِ  

malik:3-66Yaḥyá > Mālik > Zayd b. Aslam > ʿAṭāʾ b. Yasār

Yahya related to me from Malik from Zayd ibn Aslam from Ata ibn Yasar that the Messenger of Allah ﷺ said, "If you are uncertain in the prayer and do not know whether you have prayed three or four rakas, then pray a raka and make two prostrations from the sitting position before the taslim. If the raka that you prayed was the fifth, then you make it even by these two sajdas, and if it was the fourth, then the two prostrations spite Shaytan."  

مالك:٣-٦٦حَدَّثَنِي يَحْيَى عَنْ مَالِكٍ عَنْ زَيْدِ بْنِ أَسْلَمَ عَنْ عَطَاءِ بْنِ يَسَارٍ

أَنَّ رَسُولَ اللَّهِ ﷺ قَالَ إِذَا شَكَّ أَحَدُكُمْ فِي صَلاَتِهِ فَلَمْ يَدْرِ كَمْ صَلَّى أَثَلاَثًا أَمْ أَرْبَعًا فَلْيُصَلِّي رَكْعَةً وَلْيَسْجُدْ سَجْدَتَيْنِ وَهُوَ جَالِسٌ قَبْلَ التَّسْلِيمِ فَإِنْ كَانَتِ الرَّكْعَةُ الَّتِي صَلَّى خَامِسَةً شَفَعَهَا بِهَاتَيْنِ السَّجْدَتَيْنِ وَإِنْ كَانَتْ رَابِعَةً فَالسَّجْدَتَانِ تَرْغِيمٌ لِلشَّيْطَانِ  

darimi:1536Aḥmad b. ʿAbdullāh > ʿAbd al-ʿAzīz > Ibn Abū Salamah al-Mājishūn > Zayd b. Aslam > ʿAṭāʾ b. Yasār > Abū Saʿīd al-Khudrī

The Prophet ﷺ said: "If one of you does not know whether he prayed three or four (rak'ahs), let him pray a rak'ah then prostrate twice after that when he is sitting. Then if he prayed five (rak'ahs), they (the two prostrations) will make his prayer even-numbered, and if he had prayed four, they will annoy and humiliate the shaitan." (Using translation from Nasāʾī 1239)   

الدارمي:١٥٣٦أَخْبَرَنَا أَحْمَدُ بْنُ عَبْدِ اللَّهِ حَدَّثَنَا عَبْدُ الْعَزِيزِ هُوَ ابْنُ أَبِي سَلَمَةَ الْمَاجِشُونُ أَنْبَأَنَا زَيْدُ بْنُ أَسْلَمَ عَنْ عَطَاءِ بْنِ يَسَارٍ عَنْ أَبِي سَعِيدٍ الْخُدْرِيِّ قَالَ

قَالَ رَسُولُ اللَّهِ ﷺ «إِذَا لَمْ يَدْرِ أَحَدُكُمْ أَثَلَاثًا صَلَّى أَمْ أَرْبَعًا فَلْيَقُمْ فَلْيُصَلِّ رَكْعَةً ثُمَّ لِيَسْجُدْ بَعْدَ ذَلِكَ سَجْدَتَيْنِ فَإِنْ كَانَ صَلَّى خَمْسًا شَفَعَتَا لَهُ صَلَاتَهُ وَإِنْ كَانَ صَلَّى أَرْبَعًا كَانَتَا تَرْغِيمًا لِلشَّيْطَانِ» قَالَ أَبُو مُحَمَّد «آخُذُ بِهِ»  

nasai-kubra:1163Muḥammad b. Rāfiʿ > Ḥujayn b. al-Muthanná > ʿAbd al-ʿAzīz / Ibn Abū Salamah > Zayd b. Aslam > ʿAṭāʾ b. Yasār > Abū Saʿīd al-Khudrī

The Prophet ﷺ said: "If one of you does not know whether he prayed three or four (rak'ahs), let him pray a rak'ah then prostrate twice after that when he is sitting. Then if he prayed five (rak'ahs), they (the two prostrations) will make his prayer even-numbered, and if he had prayed four, they will annoy and humiliate the shaitan." (Using translation from Nasāʾī 1239)  

الكبرى للنسائي:١١٦٣أَخْبَرَنَا مُحَمَّدُ بْنُ رَافِعٍ قَالَ حَدَّثَنَا حُجَيْنُ بْنُ الْمُثَنَّى قَالَ حَدَّثَنَا عَبْدُ الْعَزِيزِ وَهُوَ ابْنُ أَبِي سَلَمَةَ عَنْ زَيْدِ بْنِ أَسْلَمَ عَنْ عَطَاءِ بْنِ يَسَارٍ عَنْ أَبِي سَعِيدٍ الْخُدْرِيِّ

عَنِ النَّبِيِّ ﷺ قَالَ «إِذَا لَمْ يَدْرِ أَحَدُكُمْ كَمْ صَلَّى ثَلَاثًا أَمْ أَرْبَعًا فَلْيُصَلِّ رَكْعَةً ثُمَّ يَسْجُدْ بَعْدَ ذَلِكَ سَجْدَتَيْنِ وَهُوَ جَالِسٌ فَإِنْ كَانَ صَلَّى خَمْسًا شَفَعَتَا لَهُ صَلَاتَهُ وَإِنْ صَلَّى أَرْبَعًا كَانَتَا تَرْغِيمًا لِلشَّيْطَانِ»  

bayhaqi:3800Abū Zakariyyā Yaḥyá b. Ibrāhīm b. Muḥammad b. Yaḥyá al-Muzakkī > Ḥamzah b. al-ʿAbbās b. al-Faḍl b. al-Ḥārith al-Bayhaqī > ʿAbbās b. Muḥammad b. Ḥātim al-Dūrī > Mūsá b. Dāwud > Sulaymān b. Bilāl > Zayd b. Aslam > ʿAṭāʾ b. Yasār > Abū Saʿīd al-Khudrī

The Messenger of Allah ﷺ said: When any one of you is in doubt about his prayer and he does Dot know how much he has prayed, three or four (rak'ahs). he should cast aside his doubt and base his prayer on what he is sure of. then perform two prostrations before giving salutations. If he has prayed five rak'ahs, they will make his prayer an even number for him, and if he has prayed exactly four, they will be humiliation for the devil. (Using translation from Muslim 571a)   

البيهقي:٣٨٠٠أَخْبَرَنَا أَبُو زَكَرِيَّا يَحْيَى بْنُ إِبْرَاهِيمَ بْنِ مُحَمَّدِ بْنِ يَحْيَى الْمُزَكِّي أنبأ حَمْزَةُ بْنُ الْعَبَّاسِ بْنِ الْفَضْلِ بْنِ الْحَارِثِ الْبَيْهَقِيُّ بِبَغْدَادَ ثنا عَبَّاسُ بْنُ مُحَمَّدِ بْنِ حَاتِمٍ الدُّورِيُّ ثنا مُوسَى بْنُ دَاوُدَ ثنا سُلَيْمَانُ بْنُ بِلَالٍ عَنْ زَيْدِ بْنِ أَسْلَمَ عَنْ عَطَاءِ بْنِ يَسَارٍ عَنْ أَبِي سَعِيدٍ الْخُدْرِيِّ قَالَ

قَالَ رَسُولُ اللهِ ﷺ إِذَا شَكَّ أَحَدُكُمْ فِي صَلَاتِهِ فَلَمْ يَدْرِ كَمْ صَلَّى ثَلَاثًا أَمْ أَرْبَعًا فَلْيَطْرَحِ الشَّكَّ وَلْيَبْنِ عَلَى مَا اسْتَيْقَنَ وَلْيَسْجُدْ سَجْدَتَيْنِ وَهُوَ جَالِسٌ قَبْلَ أَنْ يُسَلِّمَ فَإِنْ كَانَ هِيَ خَمْسًا كَانَتَا شَفْعًا وَإِنْ صَلَّى تَمَامَ الْأَرْبَعِ كَانَتَا تَرْغِيمًا لِلشَّيْطَانِ  

رَوَاهُ مُسْلِمٌ فِي الصَّحِيحِ عَنْ مُحَمَّدِ بْنِ أَحْمَدَ بْنِ أَبِي خَلَفٍ عَنْ مُوسَى بْنِ دَاوُدَ