Abu Hurairah reported,

We were with the Prophet ﷺ at Khaybar, and the Prophet ﷺ said of one of the men with him who professed Islam, "This man is among the people of the Fire."When the fighting began, the 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 he has died."The Prophet ﷺ said, "To the Fire."Some of the people nearly began to doubt. While they were in that state, word came that the man had not died after all, but had suffered severe wounds. Then during the night he could not bear the pain of his wounds, so he killed himself.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 enters Paradise but a soul in submission to Allah, and Allah عز وجل supports this religion even through a sinful man."The narrator said, this weighed heavily on some of the Muslims, and they said, "Messenger of Allah, Allah has confirmed the truth of what you said. So-and-so took his own life and killed himself."

Ahmad 8091

Sahih

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

أحمد 8091صحيح
Contents
Reference
Commentary
Ayat
Collection
Musnad Ahmad
Book
Abu Hurairah
Numbering
Darussalam 8091
Ahmad 8091