Jami` at-Tirmidhi 300
Grading supplied with this record: Sahih (Darussalam)
Narration text is preserved in its supplied Arabic and English. Translated interfaces and reading guides do not add narration translations in other languages.
اللَّهُمَّ أَنْتَ السَّلاَمُ وَمِنْكَ السَّلاَمُ تَبَارَكْتَ يَا ذَا الْجَلاَلِ وَالإِكْرَامِ "
Thawban, the freed slave of Allah's Messenger, narrated that :
Allah's Messenger said: "When Allah's Messenger wanted to turn from his Salat, he would seek forgiveness from Allah three times, then say: (Allahumma Antas-Salam, wa minkas-salam, tabarakta ya dhal-jalali wal-Ikram) 'O Allah! You are the One free of defects and perfection is from You. Blessed are You, O Possesor of Majesty and Honor.'"
Full reference and source
Jami` at-Tirmidhi 300 In-book : Book 2, Hadith 152 English translation : Vol. 1, Book 2, Hadith 300
View source on Sunnah.com (opens in a new tab)