The Messenger of Allah ﷺ stood up after the second rakah of the noon prayer without sitting. When he finished his prayer, he performed two prostrations, saying the takbir at each prostration while seated, before giving the salam. The people prostrated along with him to make up for the sitting he had forgotten.
أخبرنا أحمد بن عمرو بن السرح قال أنبأنا ابن وهب قال أخبرني عمرو ويونس والليث أن ابن شهاب أخبرهم عن عبد الرحمن الأعرج أن
أن رسول الله ﷺ قام في الثنتين من الظهر فلم يجلس فلما قضى صلاته سجد سجدتين كبر في كل سجدة وهو جالس قبل أن يسلم وسجدهما الناس معه مكان ما نسي من الجلوس
[Sahih] Bukhari narrated it in "Forgetfulness," in the chapter "Saying Allahu Akbar in the Two Sujud of Forgetfulness," hadith 1230, and Muslim in "Mosques," in the chapter "Forgetfulness in Prayer and the Sujud for It," hadith 86/570, from the hadith of Layth bin Saad, with the same chain. It is also found in Kubra, hadith 603, 604, and 1184.