كتاب الْمَسَاجِدِ وَمَوَاضِعِ الصَّلاَةِ
5  
The Book of Mosques and Places of Prayer
(19)
Chapter: As-Sahw (forgetfulness) in prayer and prostrating to compensate for it
(19)
باب السَّهْوِ فِي الصَّلاَةِ وَالسُّجُودِ لَهُ ‏
Sahih Muslim 573 c

Abu Huraira reported:

The Messenger of Allah (ﷺ) led us in the 'Asr prayer and gave salutation after two rak'ahs. Dhu'l-Yadain (the possessor of long arms) stood up and said: Messenger of Allah, has the prayer been shortened or have you forgotten? The Messenger of Allah (ﷺ) said: Nothing like this has happened (neither the prayer has been shortened nor have I forgotten). He (Dhu'l-Yadain) said: Messenger of Allah, something has definitely happened. The Messenger of Allah (ﷺ) turned towards people and said: Is Dhu'l-Yadain true (in his assertion)? They said: Messenger of Allah, he is true. Then the Messenger of Allah (ﷺ) completed the rest of the prayer. and then performed two prostrations while he was sitting after salutation.
حَدَّثَنَا قُتَيْبَةُ بْنُ سَعِيدٍ، عَنْ مَالِكِ بْنِ أَنَسٍ، عَنْ دَاوُدَ بْنِ الْحُصَيْنِ، عَنْ أَبِي سُفْيَانَ، مَوْلَى ابْنِ أَبِي أَحْمَدَ أَنَّهُ قَالَ سَمِعْتُ أَبَا هُرَيْرَةَ، يَقُولُ صَلَّى لَنَا رَسُولُ اللَّهِ صلى الله عليه وسلم صَلاَةَ الْعَصْرِ فَسَلَّمَ فِي رَكْعَتَيْنِ فَقَامَ ذُو الْيَدَيْنِ فَقَالَ أَقُصِرَتِ الصَّلاَةُ يَا رَسُولَ اللَّهِ أَمْ نَسِيتَ فَقَالَ رَسُولُ اللَّهِ صلى الله عليه وسلم ‏"‏ كُلُّ ذَلِكَ لَمْ يَكُنْ ‏"‏ ‏.‏ فَقَالَ قَدْ كَانَ بَعْضُ ذَلِكَ يَا رَسُولَ اللَّهِ ‏.‏ فَأَقْبَلَ رَسُولُ اللَّهِ صلى الله عليه وسلم عَلَى النَّاسِ فَقَالَ ‏"‏ أَصَدَقَ ذُو الْيَدَيْنِ ‏"‏ ‏.‏ فَقَالُوا نَعَمْ يَا رَسُولَ اللَّهِ ‏.‏ فَأَتَمَّ رَسُولُ اللَّهِ صلى الله عليه وسلم مَا بَقِيَ مِنَ الصَّلاَةِ ثُمَّ سَجَدَ سَجْدَتَيْنِ وَهُوَ جَالِسٌ بَعْدَ التَّسْلِيمِ ‏.‏
Reference : Sahih Muslim 573c
In-book reference : Book 5, Hadith 128
USC-MSA web (English) reference : Book 4, Hadith 1184
  (deprecated numbering scheme)