He came to the Messenger of Allah ﷺ and asked, "What do you say about a man who has committed every sin, leaving none of them out, sparing neither great nor small, but pursuing them all? Is there any repentance for him?"The Prophet ﷺ asked, "Have you embraced Islam?"The man replied, "As for me, I bear witness that there is no god but Allah alone, with no partner, and that you are the Messenger of Allah ﷺ."The Prophet ﷺ said, "Yes. Do good deeds and abandon evil ones, and Allah will turn them all into good for you."The man asked, "Even my treacheries and my wicked acts?"The Prophet ﷺ answered, "Yes."The man exclaimed, "Allahu Akbar!" And he kept saying "Allahu Akbar" until he disappeared from sight.
أنه أتى رسول الله ﷺ، فقال: أرأيت رجلا عمل الذنوب كلها، فلم يترك منها شيئا وهو في ذلك لم يترك حاجة ولا داجة إلا أتاها، فهل له من توبة؟ قال: فهل أسلمت؟ قال: أما أنا فأشهد أن لا إله إلا الله وحده لا شريك له، وأنك رسول الله ﷺ. قال: نعم تفعل الخيرات، وتترك السيئات، فيجعلهن الله لك خيرات كلهن. قال: وغدراتي وفجراتي؟ قال: نعم. فقال: الله أكبر. فما زال يكبر حتى توارى.
Bazzar narrated it in Kashf Astar (3244), Tabarani in Al-Kabir (7/375–376), and Ibn Abu Asim in Al-Ahad wal-Mathani (2718), all of them through routes from Abu Mughira (who is Abdullah bin Hajjaj), from Safwan bin Amr, from Abdul-Rahman bin Jubayr, from Abu Tawil Shatb Mamdud, who related it.The wording given here is Tabarani's, and its chain of transmission is sahih. Ibn Hajar said in Amali Mutlaqa (p. 144), "Hasan sahih gharib."