The Messenger of Allah ﷺ said:
“There was a person before you who had killed ninety-nine people and then asked about the learned people 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 (the monk) said: No.
He killed him (i.e. the monk) 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 should also worship along with them and do not stay in this 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 Allaah.”
The angels of punishment said:
“ He has done no good at all (in his life).”
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 nearer.”
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.“
Source: Arabic Saheeh Muslim 50/54