Usama bin Zayd reported,

The Messenger of Allah ﷺ sent us on an expedition to al-Huraqah. We attacked the people in the morning and routed 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 man from the Ansar held back, but I struck him with my spear and killed him.When we returned, the news reached the Prophet ﷺ, and he said, "Usama, did you kill him after he said, 'There is no god but Allah'?"I replied, "He only said it to seek protection."He kept repeating the question until I wished I had not become a Muslim before that day.

Azami 7870

Sahih

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

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

الأعظمي 7870صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Jihad
Chapter
Rulings on jihad and its etiquette
Section
Prohibition of killing one who has declared his Islam
Numbering
Jami al-Kamil 7870 (2nd edition)
Azami 7870