the Prophet (S) led them in Salat he forgot (something) so he performed two prostrations, then the Tashah-hud, then the Salam.

Jami` at-Tirmidhi Book 2, Hadith 248