Abdullah bin Buhaynah (may Allah be pleased with him) narrates that the Messenger of Allah (peace and blessings be upon him) forgot the sitting (qa'dah) in the prayer and stood up. We began waiting for the Messenger of Allah (peace and blessings be upon him) to give the salam. He prostrated, then raised his head saying the takbir, then said the takbir and performed the second prostration, then raised his head from the second prostration saying the takbir, then gave the salam.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الصلاة / 3891