On the authority of Abu Hurayrah (may Allah be pleased with him) that the Prophet (ﷺ), from among the things he reports from his Lord (mighty and sublime be He), is that he said:
A servant [of Allah's] committed a sin and said: O Allah, forgive me my sin. And He (glorified and exalted be He) said: My servant has committed a sin and has known that he has a Lord who forgives sins and punishes for them. Then he sinned again and said: O Lord, forgive me my sin. And He (glorified and exalted be He) said: My servant has committed a sin and has known that he has a Lord who forgives sins and punishes for them. Then he sinned again and said: O Lord, forgive me my sin. And He (glorified and exalted be He) said: My servant has committed a sin and has known that he has a Lord who forgives sins and punishes for sins. Do what you wish, for I have forgiven you. It was related by Muslim (also by al-Bukhari).
Reported by Muslim (No. 2758a, 2758b) and Ahmad (No. 9984). Cited in 40 Hadith Qudsi (No. 33).
The Prophet (may Allah's peace and blessings be upon him), narrating from his Almighty Lord, said: "A servant committed a sin and said: 'O Allah, forgive my sin,’ and Allah Almighty said: ‘My servant committed a sin and then realized that he has a Lord Who forgives sins and punishes for sins.'…
وعنه عن النبي صلى الله عليه وسلم، فيما يحكى عن ربه، تبارك وتعالى، قال: “أذنب عبدي ذنباً، فقال: اللهم اغفر لى ذنبي، فقال الله تبارك وتعالى: أذنب عبدى ذنبا، فعلم أن له رباً يغفر الذنب، ويأخذ بالذنب، ثم عاد فأذنب…
وعن علي بن ربيعة قال: شهدت علي بن أبي طالب رضي الله عنه أتي بدابة ليركبها، فلما وضع رجله في الركاب قال: بسم الله، فلما استوي علي ظهرها قال: الحمد لله الذي سخر لنا هذا، وما كنا له مقرنين، وإنا إلي ربنا لمنقلبون، ثم…