The Prophet (ﷺ) prayed, then he stood up after two rak'ahs while he was supposed to sit, and he continued his prayer. Then at the end of his prayer, he performed two prostrations before the Salam, then he said the Salam.
Reference: Sunan an-Nasa'i 1177 In-book : Book 12, Hadith 149 English translation : Vol. 2, Book 12, Hadith 1178
Help us gift a modern, ad-free Islamic application for the Muslim Ummah. Your donation will be recorded as Sadaqah Jariyah in your book of deeds, In Sha Allah.