Amr bin As reported,

He led the people in prayer and stood up without sitting for the tashahhud. The people called out to him, saying, "Glory be to Allah, glory be to Allah." He continued his prayer as he was, and when he completed it, he performed two prostrations. Then he said, "People, what you intended did not escape me, but nothing prevented me from sitting except what I did, following the Sunnah."

Azami 2481

Sahih

عن عمرو بن العاص

أنه صلى بالناس، فقام عن تشهده. فصاح به الناس فقالوا: سبحان الله، سبحان الله، فصلى كما هو، فلما تم صلاته سجد سجدتين ثم قال: يا أيها الناس إنه لم يخف علي الذي أردتم، ولم يمنعني من الجلوس إلا الذي صنعت من السنة.

الأعظمي 2481صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Prayer
Chapter
Forgetfulness
Section
One who stands from two rakahs, if he has straightened up he should continue, otherwise he should sit
Numbering
Jami al-Kamil 2481 (2nd edition)
Azami 2481