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:3825Abū ʿAlī al-Rūdhbārī > Abū Bakr b. Dāsah > Abū Dāwud > al-Qaʿnabī > Mālik > Zayd b. Aslam > ʿAṭāʾ b. Yasār

[Machine] The Messenger of Allah ﷺ said: "If any of you has doubts about his prayer and does not know how many units he has prayed, then he should pray one unit (rak'ah) and prostrate twice while sitting before the salutation (salam). If the prayer he has prayed is his fifth unit (rak'ah), then he should perform these two prostrations with intention of seeking forgiveness (tawbah) from Satan. This narration has been narrated from the hadith of Sulayman bin Bilal and Hisham bin Saad from Zaid bin Aslam from Ata bin Yasar from Abu Sa'id, connected in the chain of narrators. This has also been narrated from the hadith of Malik, attributed to the same chain of narrators."  

البيهقي:٣٨٢٥أَخْبَرَنَا أَبُو عَلِيٍّ الرُّوذْبَارِيُّ أنبأ أَبُو بَكْرِ بْنُ دَاسَةَ ثنا أَبُو دَاوُدَ ثنا الْقَعْنَبِيُّ عَنْ مَالِكٍ عَنْ زَيْدِ بْنِ أَسْلَمَ عَنْ عَطَاءِ بْنِ يَسَارٍ

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


See similar narrations below:

Collected by Abū Dāwūd, Mālik, Ibn Ḥibbān, Nasāʾī's Kubrá
abudawud:1026al-Qaʿnabī > Mālik > Zayd b. Aslam > ʿAṭāʾ b. Yasār

The Prophet ﷺ said: When one of you is in doubt about his prayer, and does not know how much he has prayed, three or four rak'ahs, he should pray one (additional) rak'ah and make two prostrations while sitting before giving the salutation. If the (additional) rak'ah which he prayed is the fifth one, he will make it an even number by these two prostrations. If it is the fourth one, the two prostrations will be a disgrace for the devil.  

أبو داود:١٠٢٦حَدَّثَنَا الْقَعْنَبِيُّ عَنْ مَالِكٍ عَنْ زَيْدِ بْنِ أَسْلَمَ عَنْ عَطَاءِ بْنِ يَسَارٍ

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

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."  

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

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

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

ibnhibban:2669ʿUmar b. Muḥammad al-Hamdānī > Muḥammad b. ʿUthmān al-ʿIjlī > Khālid b. Makhlad > Sulaymān b. Bilāl > Zayd b. Aslam > ʿAṭāʾ b. Yasār > Abū Saʿīd al-Khudrī

[Machine] The Messenger of Allah ﷺ said, "If any one of you is in doubt about how many rak'ahs they have prayed, whether three or four, then they should stand up and perform a complete rak'ah, with its proper bowing and prostration, and then they should perform two prostrations while sitting. If they have already performed five rak'ahs, they should complete the prayer with these two prostrations. But if they have already performed four rak'ahs, these two prostrations are a form of humiliation for the devil."  

ابن حبّان:٢٦٦٩أَخْبَرَنَا عُمَرُ بْنُ مُحَمَّدٍ الْهَمْدَانِيُّ قَالَ حَدَّثَنَا مُحَمَّدُ بْنُ عُثْمَانَ الْعِجْلِيُّ قَالَ حَدَّثَنِي خَالِدُ بْنُ مَخْلَدٍ قَالَ حَدَّثَنَا سُلَيْمَانُ بْنُ بِلَالٍ قَالَ حَدَّثَنِي زَيْدُ بْنُ أَسْلَمَ عَنْ عَطَاءِ بْنِ يَسَارٍ عَنْ أَبِي سَعِيدٍ الْخُدْرِيِّ قَالَ

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

nasai-kubra:587ʿImrān b. Yazīd > ʿAbd al-ʿAzīz > Zayd b. Aslam > ʿAṭāʾ b. Yasār > Ibn ʿAbbās

The Prophet ﷺ said: When one of you is in doubt about his prayer, and does not know how much he has prayed, three or four rak'ahs, he should pray one (additional) rak'ah and make two prostrations while sitting before giving the salutation. If the (additional) rak'ah which he prayed is the fifth one, he will make it an even number by these two prostrations. If it is the fourth one, the two prostrations will be a disgrace for the devil. (Using translation from Abū Dāʾūd 1026)   

الكبرى للنسائي:٥٨٧أَخْبَرَنِي عِمْرَانُ بْنُ يَزِيدَ قَالَ حَدَّثَنَا عَبْدُ الْعَزِيزِ قَالَ حَدَّثَنَا زَيْدُ بْنُ أَسْلَمَ عَنْ عَطَاءِ بْنِ يَسَارٍ عَنِ ابْنِ عَبَّاسٍ

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