Hadith on Prayer: When one forgets number of raka’at in prayer

Abdullah ibn Mas’ud reported: The Messenger of Allah, peace and blessings be upon him, prayed with us five cycles (raka’at). We said, “O Messenger of Allah, you added something to the prayer.” The Prophet said, “What is that?” They said, “You have prayed five cycles.” The Prophet said, “Verily, I am only a human being like you. I remember as you remember and I forget as you forget.” Then, the Prophet performed two prostrations for forgetfulness.

Source: Ṣaḥīḥ al-Bukhārī 6294, Ṣaḥīḥ Muslim 572

Grade: Muttafaqun Alayhi (authenticity agreed upon) according to Al-Bukhari and Muslim

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

6294 صحيح البخاري كتاب الأيمان والنذور باب إذا حنث ناسيا في الأيمان

572 صحيح مسلم كتاب المساجد ومواضع الصلاة باب السهو في الصلاة والسجود له