Abu Hurairah reported,

The Prophet ﷺ led us in the noon or afternoon prayer and gave the closing salutation. Dhul-Yadayn said to him, "Messenger of Allah, has the prayer been shortened?"The Prophet ﷺ asked his companions, "Is what he says true?"They replied, "Yes."So he prayed two more units, then performed two prostrations.Saad said, I saw Urwa bin Zubayr pray two units of the sunset prayer and then give the closing salutation and speak. After that, he completed what remained of the prayer and performed two prostrations, and he said, "This is how the Prophet ﷺ did it."

Bukhari 1227

Sahih

حدثنا آدم حدثنا شعبة عن سعد بن إبراهيم عن أبي سلمة

عن أبي هريرة رضي الله عنه قال

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

البخاري 1227صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Bukhari
Book
Forgetfulness
Chapter
If one gives salam after two or three rakahs, he prostrates twice like the prostration of prayer or longer
Numbering
Darussalam 1227
Bukhari 1227