Jami` at-Tirmidhi, Volume 6, Book 45, Hadith 3446 (DarusSalam)

Ali bin Rabi’ah said: “I witnessed Ali having an animal brought to him to ride. When he placed his foot in the stirrup he said: ‘In the Name of Allah,’ (Bismillāh) [three times]. So then, once he had ascended upon its back, he said: ‘All praise is due to Allah.’ (Al-ḥamdulillāh) then he said: Glory is to Him Who has subjected this to us, and we were not able to do it. And, surely, to our Lord are we returning (Subḥān alladhī sakh-khara lanā hādhā wa mā kunnā lahū muqrinīn. Wa innā ilā rabbinā lamunqalibūn). Then he said: ‘All praise is due to Allah (Al-ḥamdulillāh)’ – three times – and ‘Allah is the Greatest (Allāhu Akbar)’ – three times – ‘Glory is to You, indeed I have wronged myself, so forgive me, for indeed none forgives sins except You (Subḥānaka innī qad ẓalamtu nafsī faghfirlī fa-innahū lā yaghfirudh-dhunūba illā ant).’ Then he laughed. So I said: ‘O Commander of the Believer! What caused you to laugh?’ He said: ‘I saw the Messenger of Allah do as I did, then he laughed, so I said, ‘What cause you to laugh?’ He said: ‘Indeed, your Lord is very pleased with His worshipper when he says: “O my Lord, forgive me my sins, indeed, no one other than You forgives sins.”

حَدَّثَنَا قُتَيْبَةُ، حَدَّثَنَا أَبُو الأَحْوَصِ، عَنْ أَبِي إِسْحَاقَ، عَنْ عَلِيِّ بْنِ رَبِيعَةَ، قَالَ شَهِدْتُ عَلِيًّا أُتِيَ بِدَابَّةٍ لِيَرْكَبَهَا فَلَمَّا وَضَعَ رِجْلَهُ فِي الرِّكَابِ قَالَ بِسْمِ اللَّهِ ثَلاَثًا فَلَمَّا اسْتَوَى عَلَى ظَهْرِهَا قَالَ الْحَمْدُ لِلَّهِ ثُمَّ قَالَ ‏:‏ ‏(‏ سبْحَانَ الَّذِي سَخَّرَ لَنَا هَذَا وَمَا كُنَّا لَهُ مُقْرِنِينَ * وَإِنَّا إِلَى رَبِّنَا لَمُنْقَلِبُونَ ‏)‏ ثُمَّ قَالَ الْحَمْدُ لِلَّهِ ثَلاَثًا وَاللَّهُ أَكْبَرُ ثَلاَثًا سُبْحَانَكَ إِنِّي قَدْ ظَلَمْتُ نَفْسِي فَاغْفِرْ لِي فَإِنَّهُ لاَ يَغْفِرُ الذُّنُوبَ إِلاَّ أَنْتَ ‏.‏ ثُمَّ ضَحِكَ ‏.‏ فَقُلْتُ مِنْ أَىِّ شَيْءٍ ضَحِكْتَ يَا أَمِيرَ الْمُؤْمِنِينَ قَالَ رَأَيْتُ رَسُولَ اللَّهِ صلى الله عليه وسلم صَنَعَ كَمَا صَنَعْتُ ثُمَّ ضَحِكَ فَقُلْتُ مِنْ أَىِّ شَيْءٍ ضَحِكْتَ يَا رَسُولَ اللَّهِ قَالَ ‏"‏ إِنَّ رَبَّكَ لَيَعْجَبُ مِنْ عَبْدِهِ إِذَا قَالَ رَبِّ اغْفِرْ لِي ذُنُوبِي إِنَّهُ لاَ يَغْفِرُ الذُّنُوبَ غَيْرُكَ ‏"‏ ‏.‏ قَالَ وَفِي الْبَابِ عَنِ ابْنِ عُمَرَ رضى الله عنهما ‏.‏ قَالَ هَذَا حَدِيثٌ حَسَنٌ صَحِيحٌ ‏.‏

sunnah.com