Usama bin Zayd reported,

Usama reported, "The Messenger of Allah ﷺ sent us on an expedition to al-Huraqah. We attacked the people at dawn and defeated them. A man from the Ansar and I caught up with one of their men, and when we overtook him, he said, 'There is no god but Allah.' The Ansari held back from him, but I stabbed him with my spear and killed him.When we returned, news of this reached the Prophet ﷺ, who said, 'Usama, did you kill him after he said, There is no god but Allah?'I replied, 'He only said it to save himself.'He kept repeating the question to me until I wished I had not embraced Islam before that day."

Azami 6822

Sahih

عن أسامة بن زيد يقول

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

الأعظمي 6822صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Retaliation and crimes
Chapter
Prohibition of protected blood
Section
Stern prohibition of killing a disbeliever if he accepts Islam and pronounces the two testimonies of faith
Numbering
Jami al-Kamil 6822 (2nd edition)
Azami 6822