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.
nasai:1238Yaḥyá b. Ḥabīb b. ʿArabī > Khālid > Ibn ʿAjlān > Zayd b. Aslam > ʿAṭāʾ b. Yasār > Abū Saʿīd

The Prophet ﷺ said: "If one of you is not sure about his prayer, let him forget about what he is unsure of and complete his prayer on the basis of what he is sure of. When he is sure that he has completed it, let him prostrate twice while he is sitting. Then if he has 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."  

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

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


See similar narrations below:

Collected by Muslim, Nasāʾī, Abū Dāwūd, Ibn Mājah, Aḥmad, Ḥākim, Ibn Ḥibbān, Nasāʾī's Kubrá, Bayhaqī, Suyūṭī
muslim:571aMuḥammad b. Aḥmad b. Abū Khalaf > 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.  

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

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

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

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

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

abudawud:1024Muḥammad b. al-ʿAlāʾ > Abū Khālid > Ibn ʿAjlān > Zayd b. Aslam > ʿAṭāʾ b. Yasār > Abū Saʿīd al-Khudrī

when one of you is in doubt about his prayer (i.e, how much he has prayed), he should throw away his doubt and base his prayer on what he is sure of. When he is sure about the completion of his prayer, he should make two prostrations (at the end of the prayer). If the prayer is complete, the additional rak’ah and the two prostrations will be supererogatory prayer. If the prayer is incomplete, the additional rak’ahs will compensate it, and the two prostrations will be a disgrace for the devil.  

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

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

قَالَ أَبُو دَاوُدَ رَوَاهُ هِشَامُ بْنُ سَعْدٍ وَمُحَمَّدُ بْنُ مُطَرِّفٍ عَنْ زَيْدٍ عَنْ عَطَاءِ بْنِ يَسَارٍ عَنْ أَبِي سَعِيدٍ الْخُدْرِيِّ عَنِ النَّبِيِّ ﷺ وَحَدِيثُ أَبِي خَالِدٍ أَشْبَعُ
ibnmajah:1210Abū Kurayb > Abū Khālid al-Aḥmar > Ibn ʿAjlān > Zayd b. Aslam > ʿAṭāʾ b. Yasār > Abū Saʿīd al-Khudrī

“The Messenger of Allah ﷺ said: ‘If anyone of you is uncertain about his prayer, let him put aside uncertainty and act upon that which is certain. When he has made sure his prayer is complete, then let him prostrate twice. Then if his prayer was complete, that (extra) Rak’ah will be counted as voluntary, and if his prayer was lacking, that Rak’ah will complete his prayer, and the two prostrations will rub the Satan’s nose in the dust.’”  

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

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

ahmad:11782Mūsá b. Dāwud > Sulaymān b. Bilāl > Zayd b. Aslam > ʿAṭāʾ b. Yasār > Abū Saʿīd al-Khudrī

[Machine] The Messenger of Allah ﷺ said: "If anyone of you has doubt in their prayer and does not know whether they prayed three or four [rak'ahs], they should disregard their doubt and proceed according to what they are certain about. Then they should perform two prostrations before concluding their Salah. Because if they prayed five [rak'ahs], it will make up for their prayer as a whole." Musa said once, "If they prayed five [rak'ahs], they would make up for their prayer. And if they completed four [rak'ahs], they would prevent Satan from harm."  

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

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

ahmad:11794Yazīd And ʾAbū al-Naḍr > ʿAbd al-ʿAzīz b. ʿAbdullāh b. Abū Salamah > Zayd b. Aslam > ʿAṭāʾ b. Yasār > Abū Saʿīd al-Khudrī

[Machine] On the authority of the Prophet ﷺ, he said: If one of you has doubt during prayer and does not know whether they have prayed three or four (units), then they should get up and perform one unit of prayer (rakah). He said: Increase (the number of units of prayer) until the doubt is in the increase. Then, they should prostrate for the two prostrations of forgetfulness. If they prayed five (units of prayer), it will make up for their prayer. And if they prayed four, they will be compelled by the Satan.  

أحمد:١١٧٩٤حَدَّثَنَا يَزِيدُ وَأَبُو النَّضْرِ قَالَا أَخْبَرَنَا عَبْدُ الْعَزِيزِ بْنُ عَبْدِ اللهِ بْنِ أَبِي سَلَمَةَ عَنْ زَيْدِ بْنِ أَسْلَمَ عَنْ عَطَاءِ بْنِ يَسَارٍ عَنْ أَبِي سَعِيدٍ الْخُدْرِيِّ

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

ahmad:11830ʿAlī b. ʿAyyāsh > Muḥammad b. Muṭarrif > Zayd b. Aslam > ʿAṭāʾ b. Yasār > Abū Saʿīd al-Khudrī

[Machine] The Prophet ﷺ said, "If anyone of you has doubts about his prayer, he should cast aside the doubt and be certain about it, and then offer two prostrations (sajdahs). If he prayed five obligatory prayers, by offering these two prostrations, they will complete them. However, if he prayed four sunnah prayers, they will be an admonition to the devil."  

أحمد:١١٨٣٠حَدَّثَنَا عَلِيُّ بْنُ عَيَّاشٍ حَدَّثَنَا مُحَمَّدُ بْنُ مُطَرِّفٍ حَدَّثَنَا زَيْدُ بْنُ أَسْلَمَ عَنْ عَطَاءِ بْنِ يَسَارٍ عَنْ أَبِي سَعِيدٍ الْخُدْرِيِّ قَالَ

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

ahmad:11689Yūnus b. Muḥammad > Fulayḥ > Zayd b. Aslam > ʿAṭāʾ b. Yasār > Abū Saʿīd al-Khudrī

[Machine] The Messenger of Allah ﷺ said: "If one of you has doubts about his prayer and does not know how many units he has prayed, then he should rely on certainty until he is certain that he has completed it. Then, he should prostrate for two extra prostrations before saying the tasleem (greeting). For if his prayer was odd (witr), it will become even (shaf') by doing so, and if it was already even, then that would be a rebuke to the devil."  

أحمد:١١٦٨٩حَدَّثَنَا يُونُسُ بْنُ مُحَمَّدٍ حَدَّثَنَا فُلَيْحٌ عَنْ زَيْدِ بْنِ أَسْلَمَ عَنْ عَطَاءِ بْنِ يَسَارٍ عَنْ أَبِي سَعِيدٍ الْخُدْرِيِّ

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

hakim:1202al-Ḥākim

“The Messenger of Allah ﷺ said: ‘If anyone of you is uncertain about his prayer, let him put aside uncertainty and act upon that which is certain. When he has made sure his prayer is complete, then let him prostrate twice. Then if his prayer was complete, that (extra) Rak’ah will be counted as voluntary, and if his prayer was lacking, that Rak’ah will complete his prayer, and the two prostrations will rub the Satan’s nose in the dust.’” (Using translation from Ibn Mājah 1210)   

الحاكم:١٢٠٢حَدَّثَنَا الْحَاكِمُ أَبُو عَبْدِ اللَّهِ مُحَمَّدُ بْنُ عَبْدِ اللَّهِ الْحَافِظُ إِمْلَاءً فِي رَجَبٍ سَنَةَ خَمْسٍ وَتِسْعِينَ وَثَلَاثِ مِائَةٍ أَخْبَرَنِي مُحَمَّدُ بْنُ الْقَاسِمِ بْنِ عَبْدِ الرَّحْمَنِ الْعَتَكِيُّ ثنا إِسْمَاعِيلُ بْنُ قُتَيْبَةَ السُّلَمِيُّ وَأَحْمَدُ بْنُ مُحَمَّدِ بْنِ سِيرِينَ الْجُرْجَانِيُّ قَالَا ثنا أَبُو بَكْرِ بْنُ أَبِي شَيْبَةَ ثنا أَبُو خَالِدٍ الْأَحْمَرُ عَنِ ابْنِ عَجْلَانَ عَنْ زَيْدِ بْنِ أَسْلَمَ عَنْ عَطَاءِ بْنِ يَسَارٍ عَنْ أَبِي سَعِيدٍ الْخُدْرِيِّ قَالَ

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

هَذَا حَدِيثٌ صَحِيحٌ عَلَى شَرْطِ مُسْلِمٍ وَلَمْ يُخَرِّجَاهُ بِهَذِهِ السِّيَاقَةِ

ذِكْرُ خَبَرٍ ثَانٍ يُصَرِّحُ بِصِحَّةِ مَا ذَكَرْنَاهُ

ibnhibban:2664al-Ḥusayn b. Muḥammad b. Muṣʿab > Abū Saʿīd al-Ashaj > Abū Khālid al-Aḥmar > Ibn ʿAjlān > Zayd b. Aslam > ʿAṭāʾ b. Yasār > Abū Saʿīd al-Khudrī

“The Messenger of Allah ﷺ said: ‘If anyone of you is uncertain about his prayer, let him put aside uncertainty and act upon that which is certain. When he has made sure his prayer is complete, then let him prostrate twice. Then if his prayer was complete, that (extra) Rak’ah will be counted as voluntary, and if his prayer was lacking, that Rak’ah will complete his prayer, and the two prostrations will rub the Satan’s nose in the dust.’” (Using translation from Ibn Mājah 1210)   

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

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

nasai-kubra:1162Yaḥyá b. Ḥabīb b. ʿArabī > Khālid > Ibn ʿAjlān > Zayd b. Aslam > ʿAṭāʾ b. Yasār > Abū Saʿīd

[Machine] On the authority of Prophet Muhammad ﷺ , he said, "If any of you have doubts about your prayer, then set aside those doubts and base it on certainty. And when you are certain, then perform two prostrations while sitting."  

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

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

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)  

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

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

nasai-kubra:588Yaḥyá b. Ḥabīb b. ʿArabī > Khālid > Ibn al-Ḥārith > Ibn ʿAjlān > Zayd b. Aslam > ʿAṭāʾ > Abū Saʿīd

[Machine] On the authority of the Prophet, ﷺ , he said, "If anyone of you has doubt in his prayer, he should dispel the doubt and act upon certainty. Then, if he becomes certain, he should perform two prostrations while sitting."  

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

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

bayhaqi:3883Abū ʿAlī al-Rūdhbārī > Abū Bakr Muḥammad b. Bakr > Abū Dāwud > Muḥammad b. al-ʿAlāʾ > Abū Khālid > Ibn ʿAjlān > Zayd b. Aslam > ʿAṭāʾ b. Yasār > Abū Saʿīd al-Khudrī

when one of you is in doubt about his prayer (i.e, how much he has prayed), he should throw away his doubt and base his prayer on what he is sure of. When he is sure about the completion of his prayer, he should make two prostrations (at the end of the prayer). If the prayer is complete, the additional rak’ah and the two prostrations will be supererogatory prayer. If the prayer is incomplete, the additional rak’ahs will compensate it, and the two prostrations will be a disgrace for the devil. (Using translation from Abū Dāʾūd 1024)   

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

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

suyuti:2040a

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)   

السيوطي:٢٠٤٠a

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

[ش] ابن أبى شيبة [حم] أحمد [م] مسلم [د] أبو داود [ن] النسائي [هـ] ابن ماجة عن أبي سعيد- مالك وعبد الرزاق عن عطاء بن يسار مرسلًا