Abu Hurairah reported,

The Messenger of Allah ﷺ led us in one of the afternoon prayers, either Zuhr or Asr, and he gave the salam after only two rakahs. Then he went to a palm trunk at the front of the mosque and leaned against it, looking angry. Among the people were Abu Bakr and Umar, but they were too awed to speak. Those in a hurry rushed out, saying, "The prayer has been shortened."Then Dhul-Yadayn stood up and asked, "Messenger of Allah, has the prayer been shortened, or did you forget?"The Prophet ﷺ looked to his right and left and asked, "What is Dhul-Yadayn saying?"They replied, "He has spoken the truth. You prayed only two rakahs."So he prayed two more rakahs and gave the salam. Then he said the takbir and prostrated, then said the takbir and rose, then said the takbir and prostrated again, then said the takbir and rose.The narrator said, I was informed from Imran bin Husayn that he said, "And he gave the salam."

Muslim 1288

Sahih

حدثني عمرو الناقد وزهير بن حرب جميعا عن ابن عيينة قال عمرو حدثنا سفيان بن عيينة حدثنا أيوب قال سمعت محمد بن سيرين يقول سمعت

أبا هريرة يقول

ا صلى بنا رسول الله ﷺ إحدى صلاتي العشي إما الظهر وإما العصر فسلم في ركعتين ثم أتى جذعا في قبلة المسجد فاستند إليها مغضبا وفي القوم أبو بكر وعمر فهابا أن يتكلما وخرج سرعان الناس قصرت الصلاة فقام ذو اليدين فقال يا رسول الله أقصرت الصلاة أم نسيت فنظر النبي ﷺ يمينا وشمالا فقال ما يقول ذو اليدين قالوا صدق لم تصل إلا ركعتين فصلى ركعتين وسلم ثم كبر ثم سجد ثم كبر فرفع ثم كبر وسجد ثم كبر ورفع قال وأخبرت عن عمران بن حصين أنه قال وسلم

مسلم 1288صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Muslim
Book
Mosques and places of prayer
Chapter
Forgetfulness in prayer and sujud for it
Numbering
Darussalam 1288
Muslim 1288