While I was praying the noon prayer, the Messenger of Allah ﷺ gave the closing salutation after only two units. A man from Banu Sulaym stood up and said, "Messenger of Allah, has the prayer been shortened, or did you forget?"The Messenger of Allah ﷺ replied, "It has not been shortened, and I have not forgotten."The man said, "Messenger of Allah, you only prayed two units."The Messenger of Allah ﷺ then asked the people, "Is what Dhul-Yadayn says correct?"They answered, "Yes."So he stood and prayed the remaining two units with them.Yahya said, Damdam bin Jaws narrated to me that he heard Abu Hurayrah say, "Then the Messenger of Allah ﷺ performed two prostrations."
حدثنا حسن بن موسى حدثنا شيبان بن عبد الرحمن حدثنا يحيى بن أبي كثير عن أبي سلمة بن عبد الرحمن بن عوف
بينما أنا أصلي صلاة الظهر سلم رسول الله ﷺ من ركعتين فقام رجل من بني سليم فقال يا رسول الله أقصرت الصلاة أم نسيت فقال رسول الله ﷺ لم تقصر ولم أنسه قال يا رسول الله إنما صليت ركعتين فقال رسول الله ﷺ أحق ما يقول ذو اليدين قالوا نعم قال فقام فصلى بهم ركعتين آخرتين قال يحيى حدثني ضمضم بن جوس أنه سمع أبا هريرة يقول ثم سجد رسول الله ﷺ سجدتين
Its isnad is sahih, and its basic content is found in Bukhari 2/86, in the chapters on shortening the prayer, in the section on when one finishes the prayer with a salam after two rakahs, and in Ibn Majah 1/383, no. 1214, and Bayhaqi 2/357.