Abdullah bin Abbas reported,

A man from the tribe of Banu Sulaym passed by a group of the companions of the Messenger of Allah ﷺ while driving his sheep, and he greeted them with the salam.They said, "He only greeted us to seek protection from us."So they rose against him, killed him, and took his sheep. They then brought the sheep to the Messenger of Allah ﷺ, whereupon Allah the Exalted revealed, "Believers, when you go forth in the cause of Allah, verify matters carefully, and do not say to one who offers you the greeting of peace, 'You are not a believer'" [Nisa 4:94].

Tirmidhi 3030

Sahih

حدثنا عبد بن حميد حدثنا عبد العزيز بن أبي رزمة عن إسرائيل عن سماك بن حرب عن عكرمة

عن ابن عباس قال

مر رجل من بني سليم على نفر من أصحاب رسول الله ﷺ ومعه غنم له فسلم عليهم قالوا ما سلم عليكم إلا ليتعوذ منكم فقاموا فقتلوه وأخذوا غنمه فأتوا بها رسول الله ﷺ فأنزل الله تعالى {يا أيها الذين آمنوا إذا ضربتم في سبيل الله فتبينوا ولا تقولوا لمن ألقى إليكم السلام لست مؤمنا}

الترمذي 3030صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami Tirmidhi
Book
Tafsir of the Quran
Chapter
From Surah Al Imran
Numbering
Darussalam 3030
Tirmidhi 3030