Usama bin Zayd reported,

The Messenger of Allah ﷺ sent us on an expedition to al-Huraqah. We attacked the people at dawn and routed them. I and a man from the Ansar caught up with one of their men, and when we overpowered him, he said, "There is no god but Allah."The Ansari held back from him, but I struck him with my spear and killed him. When we returned, news of this reached the Prophet ﷺ, and he said, "Usama, did you kill him after he said, 'There is no god but Allah'?"I said, "He only said it to seek protection."He kept repeating it to me until I wished I had not become a Muslim before that day.

Azami 194

Sahih

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

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

الأعظمي 194صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Faith
Chapter
Qualities of faith
Section
Prohibition of killing a disbeliever after he says there is no god but Allah, even if he had harmed the Muslims
Numbering
Jami al-Kamil 194 (2nd edition)
Azami 194