There was a person before you who had killed ninety-nine persons and then made an inquiry about the learned persons of the world (who could show him the way to salvation). He was directed to a monk. He came to him and told him that he had killed ninety-nine persons and asked him whether there was any scope for his repentance to be accepted. He said: No. He killed him also and thus completed one hundred. He then asked about the learned persons of the earth and he was directed to a scholar, and he told him that he had killed one hundred persons and asked him whether there was any scope for his repentance to be accepted. He said: Yes; what stands between you and the repentance? You better go to such and such land; there are people devoted to prayer and worship and you also worship along with them and do not come to the land of yours since it was an evil land (for you). So he went away and he had hardly covered half the distance when death came to him and there was a dispute between the angels of mercy and the angels of punishment. The angels of mercy said: This man has come as a penitant and remorseful to Allah and the angels of punishment said: He has done no good at all. Then there came another angel in the form of a human being in order to decide between them. He said: You measure the land to which he has drawn near. They measured it and found him nearer to the land where he intended to go (the land of piety), and so the angels of mercy took possession of it. Qatada said that Hasan told him that it was said to them that as death approached him, he crawled upon his chest (and managed) to slip in the land of mercy. (Using translation from Muslim 2766a)
أَنَّ رَسُولَ اللهِ ﷺ قَالَ كَانَ مِمَّنْ كَانَ قَبْلَكُمْ رَجُلٌ قَتَلَ تِسْعَةً وَتِسْعِينَ نَفْسًا فَسَأَلَ عَنْ أَعْلَمِ أَهْلِ الْأَرْضِ فَدُلَّ عَلَى رَاهِبٍ فَأَتَاهُ فَقَالَ إِنَّهُ قَتَلَ تِسْعَةً وَتِسْعِينَ نَفْسًا فَهَلْ لَهُ مِنْ تَوْبَةٍ؟ قَالَ لَا فَقَتَلَهُ فَكَمَّلَ بِهَ مِائَةً ثُمَّ سَأَلَ عَنْ أَعْلَمِ أَهْلِ الْأَرْضِ فَدُلَّ عَلَى رَجُلٍ عَالِمٍ فَأَتَاهُ فَقَالَ قَتَلَ مِائَةَ نَفْسٍ فَهَلْ لَهُ مِنْ تَوْبَةٍ؟ فَقَالَ نَعَمْ وَمَنْ يَحُولُ بَيْنَهُ وَبَيْنَ التَّوْبَةِ انْطَلِقْ إِلَى أَرْضِ كَذَا وَكَذَا فَإِنَّ بِهَا نَاسًا يَعْبُدُونَ اللهَ فَاعْبُدْ مَعَهُمْ وَلَا تَرْجِعْ إِلَى أَرْضِكَ فَإِنَّهَا أَرْضُ سُوءٍ فَانْطَلَقَ حَتَّى إِذَا أَتَى نِصْفَ الطَّرِيقِ أَتَاهُ الْمَوْتُ فَاخْتَصَمَتْ فِيهِ مَلَائِكَةُ الرَّحْمَةِ وَمَلَائِكَةُ الْعَذَابِ فَقَالَتْ مَلَائِكَةُ الرَّحْمَةِ جَاءَ تَائِبًا مُقْبِلًا بِقَلْبِهِ إِلَى اللهِ ﷻ وَقَالَتْ مَلَائِكَةُ الْعَذَابِ إِنَّهُ لَمْ يَعْمَلْ خَيْرًا قَطُّ فَأَتَاهُمْ مَلَكٌ فِي صُورَةِ آدَمِيٍّ فَجَعَلُوهُ بَيْنَهُمْ فَقَالَ قِيسُوا مَا بَيْنَ الْأَرَضِينَ فَإِلَى أَيِّهَا كَانَ أَدْنَى فَهُوَ لَهُ فَقَاسُوا فَوَجَدُوهُ أَدْنَى إِلَى الْأَرْضِ الَّتِي أَرَادَ فَقَبَضَتْهُ مَلَائِكَةُ الرَّحْمَةِ قَالَ قَتَادَةُ فَقَالَ الْحَسَنُ ذُكِرَ لَنَا أَنَّهُ لَمَّا أَتَاهُ الْمَوْتُ نَاءَ بِصَدْرِهِ