Sunan Ibn Majah, Book 21, Hadith 2720 (In-Book)

It was narrated that Abu Sa'eed Al Khudri said: “Shall I not tell you what I heard directly from the Messenger of Allah? I heard it and memorized it: 'A man killed ninety-nine people, then the idea of repentance occurred to him. He asked who was the most knowledgeable of people on earth, and he was told of a man so he went to him and said: “I have killed ninety-nine people. Can I repent?” He said: “After ninety-nine people?!” He said: 'So he drew his sword and killed him, thus completing one hundred. Then the idea of repentance occurred to him (again), so he asked who was the most knowledgeable of people, and he was told of a man (so he went to him) and said: “I have killed one hundred people. Can I repent?” He said: “Woe to you, what is stopping you from repenting? Leave the evil town where you are living and go to a good town, such and such town and worship your Lord there.” So he went out, heading for the good town, but death came to him on the road. The angels of mercy and angels of punishment argued over him. Iblis (Satan) said: “I have more right to him, for he never disobeyed me for a moment.” But the angels of mercy said: “He went out repenting.” (One of the narrators) Hammam said: “Humaid At-Tawil narrated to me from Bakr bin Abdullah that Abu Rafi said: 'So Allah (SWT) sent an angel to whom they referred (the case). He said: “Look and see which of the two towns was he closer, and put him with its people.” (One of the narrators) Qatadah said: “Hasan narrated to us: 'When death came to him he strove and drew closer to the good town, and farther away from the evil town, so they put him with the people of the good town.”

حَدَّثَنَا أَبُو بَكْرِ بْنُ أَبِي شَيْبَةَ، حَدَّثَنَا يَزِيدُ بْنُ هَارُونَ، أَنْبَأَنَا هَمَّامُ بْنُ يَحْيَى، عَنْ قَتَادَةَ، عَنْ أَبِي الصِّدِّيقِ النَّاجِيِّ، عَنْ أَبِي سَعِيدٍ الْخُدْرِيِّ، قَالَ أَلاَ أُخْبِرُكُمْ بِمَا، سَمِعْتُ مِنْ، فِي رَسُولِ اللَّهِ صلى الله عليه وسلم سَمِعَتْهُ أُذُنَاىَ وَوَعَاهُ قَلْبِي ‏ "‏ إِنَّ عَبْدًا قَتَلَ تِسْعَةً وَتِسْعِينَ نَفْسًا ثُمَّ عَرَضَتْ لَهُ التَّوْبَةُ فَسَأَلَ عَنْ أَعْلَمِ أَهْلِ الأَرْضِ فَدُلَّ عَلَى رَجُلٍ فَأَتَاهُ ‏.‏ فَقَالَ إِنِّي قَتَلْتُ تِسْعَةً وَتِسْعِينَ نَفْسًا فَهَلْ لِي مِنْ تَوْبَةٍ قَالَ بَعْدَ تِسْعَةٍ وَتِسْعِينَ نَفْسًا ‏.‏ قَالَ فَانْتَضَى سَيْفَهُ فَقَتَلَهُ فَأَكْمَلَ بِهِ الْمِائَةَ ثُمَّ عَرَضَتْ لَهُ التَّوْبَةُ فَسَأَلَ عَنْ أَعْلَمِ أَهْلِ الأَرْضِ فَدُلَّ عَلَى رَجُلٍ فَأَتَاهُ فَقَالَ إِنِّي قَتَلْتُ مِائَةَ نَفْسٍ فَهَلْ لِي مِنْ تَوْبَةٍ قَالَ فَقَالَ وَيْحَكَ وَمَنْ يَحُولُ بَيْنَكَ وَبَيْنَ التَّوْبَةِ اخْرُجْ مِنَ الْقَرْيَةِ الْخَبِيثَةِ الَّتِي أَنْتَ فِيهَا إِلَى الْقَرْيَةِ الصَّالِحَةِ قَرْيَةِ كَذَا وَكَذَا فَاعْبُدْ رَبَّكَ فِيهَا ‏.‏ فَخَرَجَ يُرِيدُ الْقَرْيَةَ الصَّالِحَةَ فَعَرَضَ لَهُ أَجَلُهُ فِي الطَّرِيقِ فَاخْتَصَمَتْ فِيهِ مَلاَئِكَةُ الرَّحْمَةِ وَمَلاَئِكَةُ الْعَذَابِ قَالَ إِبْلِيسُ أَنَا أَوْلَى بِهِ إِنَّهُ لَمْ يَعْصِنِي سَاعَةً قَطُّ ‏.‏ قَالَ فَقَالَتْ مَلاَئِكَةُ الرَّحْمَةِ إِنَّهُ خَرَجَ تَائِبًا ‏" ‏ ‏.‏

sunnah.com