Jami` at-Tirmidhi #408
The Book on Salat (Prayer) 2:261
Abdullah bin Amr narrated that:
Allah's Messenger (S) said: "When he commits Hadath - meaning a man - and he is sitting in the end of his Salat before saying the Taslim, then his Salat is acceptable."