The Prophet (peace and blessings of Allaah be upon him) said:
“There was among the people who came before you a man who killed ninety-nine people. Then he asked about the most knowledgeable person on earth, and was directed to a hermit, so he went to him, told him that he had killed ninety-nine people, and asked if he could be forgiven. The hermit said, ‘No,’ so he killed him, thus completing one hundred. Then he asked about the most knowledgeable person on earth and was directed to a scholar. He told him that he had killed one hundred people, and asked whether he could be forgiven. The scholar said, ‘Yes, what could possibly come between you and repentance? Go to such-and-such a town, for in it there are people who worship Allaah. Go and worship with them, and do not go back to your own town, for it is a bad place.” So the man set off, but when he was halfway there, the angel of death came to him, and the angels of mercy and the angels of wrath began to argue over him. The angels of mercy said: ‘He had repented and was seeking Allaah.’ The angels of wrath said: ‘He never did any good thing.’ An angel in human form came to them, and they asked him to decide the matter. He said: ‘Measure the distance between the two lands (his home town and the town he was headed for), and whichever of the two he is closest to is the one to which he belongs.’ So they measured the distance, and found that he was closer to the town for which he had been headed, so the angels of mercy took him.” (Agreed upon). According to a report in al-Saheeh: “The righteous town was a hand-span closer, so he was counted as one of its people.” According to another report in al-Saheeh: “Allaah commanded (the evil town) to move away, and (the righteous town) to move closer, and said: ‘Measure the distance between them,’ and they found him to be a hand-span closer to the righteous town, so he was forgiven.”
What then can come between a person and repentance? Do you think that your sins are any greater than the sins of this man, whose repentance Allaah accepted? So why despair? The matter is even greater than this.
Think about the words of Allaah (interpretation of the meaning): “And those who invoke not any other god along with Allaah, nor kill such life as Allaah has forbidden, except for just cause, nor commit illegal sexual intercourse – and whoever does this shall receive the punishment. The torment shall be doubled to him on the Day of Resurrection, and he will abide therein in disgrace; except those who repent and believe, and do righteous deeds; for those, Allaah will change their sins into good deeds, and Allaah is Oft-Forgiving, Most Merciful.” [al-Furqaan 25:68-70].