Usama bin Zayd reported,

Usama said, "The Messenger of Allah ﷺ sent us on an expedition against the Huraqah tribe of Juhaynah. We surprised them at dawn and defeated them. A man from the Ansar and I caught up with one of their men. When we closed in on him, he said, 'There is no god but Allah.' The Ansari held back from him, but I thrust him with my spear until I killed him.When we returned, news of this reached the Prophet ﷺ, and he said to me, 'Usama, did you kill him after he said there is no god but Allah?'I said, 'Messenger of Allah, he only said it to save himself.'He said, 'Did you kill him after he said there is no god but Allah?'He kept repeating this to me until I wished I had not become a Muslim before that day."

Bukhari 6872

Sahih

حدثنا عمرو بن زرارة حدثنا هشيم حدثنا حصين حدثنا أبو ظبيان قال سمعت

أسامة بن زيد بن حارثة رضي الله عنهما يحدث

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

البخاري 6872صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Bukhari
Book
Blood money
Chapter
His saying, "And whoever saves one"
Numbering
Darussalam 6872
Bukhari 6872