Muwatta Malik, Book 3, Hadith 218 (In-Book)

Yahya related to me from Malik from Yahya ibn Said from Abd ar- Rahman ibn Hurmuz that Abdullah ibn Buhayna said, "The Messengerof Allah, may Allah bless him and grant him peace, prayed dhuhr with us and he stood straight up after two rakas without sitting. When he had finished the prayer, he did two sajdas and then said the taslim after that." Malik said, concerning someone who forgot in his prayer and stood up after he had completed four rakas and recited and then went into ruku and then, when he raised his head from ruku, remembered that he had already completed (his prayer), "He returns to a sitting position and does not do any sajda. If he has already done one sajda I do not think he should do the other. Then when his prayer is finished he does two sajdas from the sitting position after saying the taslim."

وَحَدَّثَنِي عَنْ مَالِكٍ، عَنْ يَحْيَى بْنِ سَعِيدٍ، عَنْ عَبْدِ الرَّحْمَنِ بْنِ هُرْمُزَ، عَنْ عَبْدِ اللَّهِ ابْنِ بُحَيْنَةَ، أَنَّهُ قَالَ صَلَّى لَنَا رَسُولُ اللَّهِ صلى الله عليه وسلم الظُّهْرَ فَقَامَ فِي اثْنَتَيْنِ وَلَمْ يَجْلِسْ فِيهِمَا فَلَمَّا قَضَى صَلاَتَهُ سَجَدَ سَجْدَتَيْنِ ثُمَّ سَلَّمَ بَعْدَ ذَلِكَ ‏.‏

sunnah.com

also referenced under: Book 3, Hadith 71 (USC-MSA)