Imran bin Husayn reported,

The Messenger of Allah ﷺ gave the closing salam after only three rakahs of the afternoon prayer, then he stood up and entered his chamber. A man with long arms named Khirbaq rose and called out, "Messenger of Allah, has the prayer been shortened?"He came out angrily, dragging his lower garment, and asked about it. When he was informed of what had happened, he prayed the rakah he had omitted, then gave the salam, then made two prostrations, and then gave the salam again.

Ibn Majah 1215

Sahih

حدثنا محمد بن المثنى وأحمد بن ثابت الجحدري حدثنا عبد الوهاب حدثنا خالد الحذاء عن أبي قلابة عن أبي المهلب

عن عمران بن الحصين قال

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

ابن ماجه 1215صحيح
Contents
Reference
Commentary
Ayat
Collection
Sunan Ibn Majah
Book
Establishing prayer and the sunnah regarding it
Chapter
Regarding one who gave salaam after two or three rakaat forgetfully
Numbering
Darussalam 1215
Ibn Majah 1215