Abu Hurairah reported,

The Prophet ﷺ led them in the afternoon or noon prayer. He stood up after the second rakah, and they said "subhan Allah" to alert him, but he continued with his prayer. When he had completed the prayer, he performed two prostrations, then gave the salam.

Azami 2483

Sahih

عن أبي هريرة

أن النبي ﷺ صلى بهم صلاة العصر، أو الظهر، فقام في الركعتين، فسبحوا به فمضى في صلاته. فلما قضى الصلاة سجد سجدتين، ثم سلم.

الأعظمي 2483صحيح
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 2483 (2nd edition)
Azami 2483