Abu Aswad reported,

A military expedition was levied upon the people of Medina, and I enrolled myself in it. I then met Ikrima and informed him, but he forbade me from doing so in the strongest terms.Then he said, Ibn Abbas told me that some people from among the Muslims used to be with the polytheists, swelling the ranks of the polytheists against the Messenger of Allah ﷺ. An arrow would come flying and strike one of them, killing him, or a sword blow would fall and kill him. So Allah Almighty revealed, "Indeed, those whom the angels take in death while wronging themselves" [Nisa 4:97].

Bukhari 7085

Sahih

حدثنا عبد الله بن يزيد حدثنا حيوة وغيره قال حدثنا أبو الأسود وقال الليث

عن أبي الأسود قال

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

البخاري 7085صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Bukhari
Book
Tribulations
Chapter
Those who disliked increasing the numbers of those involved in tribulations and injustice
Numbering
Darussalam 7085
Bukhari 7085