كتاب الْمَسَاجِدِ وَمَوَاضِعِ الصَّلاَةِ
5  
The Book of Mosques and Places of Prayer
(19)
Chapter: As-Sahw (forgetfulness) in prayer and prostrating to compensate for it
(19)
باب السَّهْوِ فِي الصَّلاَةِ وَالسُّجُودِ لَهُ ‏
Sahih Muslim 570 b

'Abdullah b. Buhaina al-Asadi, the ally of Abual-Muttalib, reported:

The Messenger of Allah (ﷺ) stood up in the noon prayer (though) he hadith sit (after the two rak'ahs). When he completed the prayer he performed two prostrations and said," Allah is the Most Great" in each prostration, while he was sitting before pronouncing salutation, and the people performed prostration along with him. That was a compensation for he had forgotten to observe jalsa (after two rak'ahs).
وَحَدَّثَنَا قُتَيْبَةُ بْنُ سَعِيدٍ، حَدَّثَنَا لَيْثٌ، ح قَالَ وَحَدَّثَنَا ابْنُ رُمْحٍ، أَخْبَرَنَا اللَّيْثُ، عَنِ ابْنِ شِهَابٍ، عَنِ الأَعْرَجِ، عَنْ عَبْدِ اللَّهِ ابْنِ بُحَيْنَةَ الأَسْدِيِّ، حَلِيفِ بَنِي عَبْدِ الْمُطَّلِبِ أَنَّ رَسُولَ اللَّهِ صلى الله عليه وسلم قَامَ فِي صَلاَةِ الظُّهْرِ وَعَلَيْهِ جُلُوسٌ فَلَمَّا أَتَمَّ صَلاَتَهُ سَجَدَ سَجْدَتَيْنِ يُكَبِّرُ فِي كُلِّ سَجْدَةٍ وَهُوَ جَالِسٌ قَبْلَ أَنْ يُسَلِّمَ وَسَجَدَهُمَا النَّاسُ مَعَهُ مَكَانَ مَا نَسِيَ مِنَ الْجُلُوسِ ‏.‏
Reference : Sahih Muslim 570b
In-book reference : Book 5, Hadith 108
USC-MSA web (English) reference : Book 4, Hadith 1164
  (deprecated numbering scheme)