He said, "The Messenger of Allah ﷺ led us in two rakahs, then stood up without sitting, and the people stood with him. When he completed his prayer and we were waiting for the taslim, he said the takbir and performed two prostrations while seated, before the taslim, then the Messenger of Allah ﷺ gave the taslim."
حدثنا القعنبي عن مالك عن ابن شهاب عن عبد الرحمن الأعرج
أنه قال صلى لنا رسول الله ﷺ ركعتين ثم قام فلم يجلس فقام الناس معه فلما قضى صلاته وانتظرنا التسليم كبر فسجد سجدتين وهو جالس قبل التسليم ثم سلم ﷺ
Bukhari narrated it in the Book of Forgetfulness, chapter "What Has Been Said Regarding Forgetfulness When One Stands Up from Two Rakahs of the Obligatory Prayer," hadith no. 1224, from the hadith of Malik. Muslim also narrated it in the Book of Mosques, chapter "Forgetfulness in Prayer and the sujud for It," hadith no. 570, from the hadith of Ibn Shihab Zuhri, through the same chain, and it is found in Muwatta (Yahya's version), 1/96.