Abu Hurairah said, "The Prophet ﷺ led us in one of the two afternoon prayers." Abu Hurairah added, "But I have forgotten which one."He said, "He prayed two rakahs with us, then gave the salam. He then walked over to a piece of wood that lay across the mosque and leaned his hand on it as though he were angry. Those in a hurry rushed out through the doors of the mosque, saying, 'The prayer has been shortened.' Among the people were Abu Bakr and Umar , but they were too in awe of him to speak to him. Also among the people was a man with long arms who was called Dhul-Yadayn. He said, 'Messenger of Allah, did you forget, or has the prayer been shortened?'He replied, 'I have not forgotten, nor has the prayer been shortened.'Then he asked, 'Is it as Dhul-Yadayn says?'They said, 'Yes.'So he came forward and prayed what he had left out, then gave the salam. Then he said the takbir and prostrated like his usual prostration or longer, then raised his head and said the takbir. Then he said the takbir again and prostrated like his usual prostration or longer, then raised his head and said the takbir."
أخبرنا حميد بن مسعدة قال حدثنا يزيد وهو ابن زريع قال حدثنا ابن عون
قال أبو هريرة صلى بنا النبي ﷺ إحدى صلاتي العشي قال قال أبو هريرة ولكني نسيت قال فصلى بنا ركعتين ثم سلم فانطلق إلى خشبة معروضة في المسجد فقال بيده عليها كأنه غضبان وخرجت السرعان من أبواب المسجد فقالوا قصرت الصلاة وفي القوم أبو بكر وعمر رضي الله عنهما فهاباه أن يكلماه وفي القوم رجل في يديه طول قال كان يسمى ذا اليدين فقال يا رسول الله أنسيت أم قصرت الصلاة قال لم أنس ولم تقصر الصلاة قال وقال أكما قال ذو اليدين قالوا نعم فجاء فصلى الذي كان تركه ثم سلم ثم كبر فسجد مثل سجوده أو أطول ثم رفع رأسه وكبر ثم كبر ثم سجد مثل سجوده أو أطول ثم رفع رأسه ثم كبر
Bukhari transmitted it, in the Book of Prayer, Chapter on Interlacing the Fingers in the Masjid and Elsewhere, hadith no. 482, from the hadith of Ibn Awn. Muslim also transmitted it, in the Book of Masjids, Chapter on Forgetfulness in Prayer and the Sujud for It, hadith no. 573, from the hadith of Muhammad bin Sirin, with the same wording. It is also found in Al-Kubra, hadith no. 1147.