Abdullah bin Malik Ibn Buhayna reported,

The Messenger of Allah ﷺ stood up at the even rakah in which he had meant to sit during his prayer, and he continued on with his prayer. Then, at the end of the prayer, he prostrated before giving the salutation, and afterward he gave the salutation.

Muslim 1271

Sahih

و حدثنا أبو الربيع الزهراني حدثنا حماد حدثنا يحيى بن سعيد عن عبد الرحمن الأعرج

عن عبد الله بن مالك ابن بحينة الأزدي

أن رسول الله ﷺ قام في الشفع الذي يريد أن يجلس في صلاته فمضى في صلاته فلما كان في آخر الصلاة سجد قبل أن يسلم ثم سلم

مسلم 1271صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Muslim
Book
Mosques and places of prayer
Chapter
Forgetfulness in prayer and sujud for it
Numbering
Darussalam 1271
Muslim 1271