It is narrated from Hazrat Abu Huraira (may Allah be pleased with him) that the Holy Prophet (peace and blessings of Allah be upon him) said: Allah Almighty smiles at two men, one of whom killed the other, but both of them enter Paradise. The explanation of this is that one man was a disbeliever; he martyred a Muslim, then Allah granted the killer repentance, and he also accepted Islam and was martyred fighting in the way of Allah, and Allah Almighty granted both of them entry into Paradise.
Hadith Referenceمسند احمد / مسند المكثرين من الصحابة / 9976