The Prophet ﷺ prayed three (rak'ahs) then said the taslim. Al-Khirbaq said: "You prayed three." So he led them in praying the remaining rak'ah, then he said the taslim, then he did the two prostrations of forgetfulness, then he said the taslim (again). (Using translation from Nasāʾī 1331)
أَنَّ النَّبِيَّ ﷺ صَلَّى ثَلَاثًا ثُمَّ سَلَّمَ فَقَالَ الْخِرْبَاقُ «إِنَّكَ صَلَّيْتَ ثَلَاثًا فَصَلَّى بِهِمُ الرَّكْعَةَ الْبَاقِيَةَ ثُمَّ سَلَّمَ ثُمَّ سَجَدَ سَجْدَتَيِ السَّهْوِ ثُمَّ سَلَّمَ»