A group of the Prophet's ﷺ companions passed by a man from the tribe of Banu Sulaym who was tending his flock of sheep. He greeted them with the salaam, but they said, "He only greeted us to seek protection from us." So they set upon him, killed him, and took his sheep. They brought the sheep to the Prophet ﷺ, and Allah revealed, "And do not say to one who offers you greetings of peace, 'You are not a believer,' seeking the transient goods of worldly life" [Nisa 4:94], to the end of the verse.
حدثنا يحيى بن آدم حدثنا إسرائيل عن سماك عن عكرمة
مر نفر من أصحاب النبي ﷺ على رجل من بني سليم معه غنم له فسلم عليهم فقالوا ما سلم عليكم إلا تعوذا منكم فعمدوا إليه فقتلوه وأخذوا غنمه فأتوا بها النبي ﷺ فأنزل الله تبارك وتعالى {ولا تقولوا لمن ألقى إليكم السلام لست مؤمنا تبتغون عرض الحياة الدنيا} إلى آخر الآية