Abu Hurairah reported,

Salama said, "We were with the Messenger of Allah ﷺ at Khaybar when he said of a man who claimed to be a Muslim, 'This man is among the people of the Fire.'When the fighting began, that man fought fiercely and was wounded. Someone said, 'Messenger of Allah, the man you said was among the people of the Fire fought fiercely today and has died.'The Prophet ﷺ said, 'He is in the Fire.'Some of the people nearly began to doubt. While they were in that state, word came that the man had not died but was severely wounded. When night came, he could not bear the pain of his wounds and took his own life. The Prophet ﷺ was told of this and said, 'Allah is greatest. I bear witness that I am the servant of Allah and His Messenger.'Then he ordered Bilal to announce to the people, 'None shall enter Paradise except a Muslim soul, and indeed Allah supports this religion even by means of a wicked man.'"

Azami 97

Sahih

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

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

الأعظمي 97صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Faith
Chapter
Qualities of faith
Section
None shall enter Paradise except a believing man, and Allah supports this religion through the wicked man
Numbering
Jami al-Kamil 97 (2nd edition)
Azami 97