Abu Hurairah reported,

The Messenger of Allah ﷺ said, "Allah smiles upon two men, one of whom kills the other, yet both enter Paradise. One fights in the cause of Allah and is martyred, then Allah accepts the repentance of his killer, who embraces Islam, fights in the cause of Allah, and is himself martyred."

Ibn Majah 191

Sahih

حدثنا أبو بكر بن أبي شيبة حدثنا وكيع عن سفيان عن أبي الزناد عن الأعرج

عن أبي هريرة قال

قال رسول الله ﷺ إن الله يضحك إلى رجلين يقتل أحدهما الآخر كلاهما دخل الجنة يقاتل هذا في سبيل الله فيستشهد ثم يتوب الله على قاتله فيسلم فيقاتل في سبيل الله فيستشهد

ابن ماجه 191صحيح
Contents
Reference
Commentary
Ayat
Collection
Sunan Ibn Majah
Book
Sunnah
Chapter
What the Jahmiyyah denied
Numbering
Darussalam 191
Ibn Majah 191