Abu Hurairah reported,

The Prophet ﷺ, relating from his Lord عز وجل, said, "A servant committed a sin and said, 'Allah, forgive me my sin.' Allah تبارك وتعالى said, 'My servant has committed a sin and has come to know that he has a Lord who forgives sin and holds accountable for sin.' Then he returned and sinned again and said, 'My Lord, forgive me my sin.' Allah تبارك وتعالى said, 'My servant has committed a sin and has come to know that he has a Lord who forgives sin and holds accountable for sin.' Then he returned and sinned again and said, 'My Lord, forgive me my sin.' Allah تبارك وتعالى said, 'My servant has committed a sin and has come to know that he has a Lord who forgives sin and holds accountable for sin. Do as you wish, for I have forgiven you.'"Abdul-Ala said, "I do not know whether he said 'Do as you wish' on the third or the fourth occasion."

Muslim 6986

Sahih

حدثني عبد الأعلى بن حماد حدثنا حماد بن سلمة عن إسحق بن عبد الله بن أبي طلحة عن عبد الرحمن بن أبي عمرة

عن أبي هريرة

عن النبي ﷺ فيما يحكي عن ربه عز وجل قال أذنب عبد ذنبا فقال اللهم اغفر لي ذنبي فقال تبارك وتعالى أذنب عبدي ذنبا فعلم أن له ربا يغفر الذنب ويأخذ بالذنب ثم عاد فأذنب فقال أي رب اغفر لي ذنبي فقال تبارك وتعالى عبدي أذنب ذنبا فعلم أن له ربا يغفر الذنب ويأخذ بالذنب ثم عاد فأذنب فقال أي رب اغفر لي ذنبي فقال تبارك وتعالى أذنب عبدي ذنبا فعلم أن له ربا يغفر الذنب ويأخذ بالذنب اعمل ما شئت فقد غفرت لك قال عبد الأعلى لا أدري أقال في الثالثة أو الرابعة اعمل ما شئت

مسلم 6986صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Muslim
Book
Tawba
Chapter
Acceptance of repentance from sins even if the sins and repentance are repeated
Numbering
Darussalam 6986
Muslim 6986