Abu Sa’id Khudri (Radiallahu anhu) narrates that Nabi (Salalaahu alaihi wa salam) said, “Among the people of the past, was a man who had killed ninety-nine people. He then asked about the most knowledgeable person in the land. He was directed to a monk, so he went to him and asked, ‘I have killed ninety-nine people. Can I repent?”
The monk replied, ‘No.’
So he killed the monk, bringing the number he had killed to one hundred. He again asked about the most knowledgeable person in the land, and was directed to a certain scholar. He approached the scholar and said, ‘I have killed one hundred people. Can I repent?’
The scholar replied, ‘Yes, who can stop you from repenting? Go to such and such a land, where there are people who worship Allah. Join them in worship and do not return to your own land, for it is a land of evil.’
So he set out, and when he had travelled exactly half the distance, death overcame him. The angels of mercy and punishment began to argue over who would take his soul.
The angels of mercy said, “He was coming towards Allah with a repentant heart.”
Then angels of punishment said, “But, he did not perform a single good deed in his entire life.”
An angel came to them in human form and they appointed him as a mediator. He said, ‘Measure the distance between the two lands, and whichever he is closer to, is where he belongs.’ So they measured the distance and found that he was closer to the land to which he was headed, so the angels of mercy took his soul.
The mercy of Allah Ta’ala is boundless.
One who repents from a sin should flee from it just as Yusuf (Alaihis salaam) fled from Zulaikha when she attempted to seduce him.