When the Prophet ﷺ came out of the lavatory, he would say, "I seek Your forgiveness."
حدثنا محمد بن إسمعيل حدثنا مالك بن إسمعيل عن إسرائيل بن يونس عن يوسف بن أبي بردة عن أبيه
كان النبي ﷺ إذا خرج من الخلاء قال غفرانك
No references are available.
Its isnad is sahih. Abu Dawud narrated it in the Book of Purification, chapter on what a man says when he leaves the toilet, hadith 30, and Ibn Majah, hadith 300, from the hadith of Israil, with the same wording. It is also found in Ilal Mutanahiya through the route of Tirmidhi, 1/330, hadith 540. Ibn Khuzayma graded it sahih, 1/48, hadith 90, as did Ibn Hibban [al-Ihsan], hadith 1441, and Hakim, 1/158, and Dhahabi and others.