حَدَّثَنَا مُحَمَّدُ بْنُ عَبْدِ اللَّهِ بْنِ الزُّبَيْرِ حَدَّثَنَا مَسَرَّةُ بْنُ مَعْبَدٍ عَنْ يَزِيدَ بْنِ أَبِي كَبْشَةَ عَنْ عُثْمَانَ بْنِ عَفَّانَ رَضِيَ اللَّهُ عَنْهُ قَالَ جَاءَ رَجُلٌ إِلَى النَّبِيِّ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ فَقَالَ يَا رَسُولَ اللَّهِ إِنِّي صَلَّيْتُ فَلَمْ أَدْرِ أَشَفَعْتُ أَمْ أَوْتَرْتُ فَقَالَ رَسُولُ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ إِيَّايَ وَأَنْ يَتَلَعَّبَ بِكُمْ الشَّيْطَانُ فِي صَلَاتِكُمْ مَنْ صَلَّى مِنْكُمْ فَلَمْ يَدْرِ أَشَفَعَ أَوْ أَوْتَرَ فَلْيَسْجُدْ سَجْدَتَيْنِ فَإِنَّهُمَا تَمَامُ صَلَاتِهِ
مسند امام احمد بن حنبل · Hadith 450
It was narrated that 'Uthman bin 'Affan (RA) said: A man came to the Prophet (PBUH) and said: O Messenger of Allah, I prayed but I do not know whether i did an even number [of rak'ahs] or an odd number. The Messenger of Allah (PBUH) said: "Beware lest the Shaitan toy with you in your prayer. Whoever among you prays and does not know whether he did an even number [of rak'ahs] or an odd number, let him prostrate twice, for that will complete his prayer."
Translated by Dr. Muhammad Muhsin Khan · Reviewed by Islamic University of Madinah · Published March 2020
