The Muslims caught up with a man who was tending his flock. He said, "Peace be upon you," but they killed him and seized his flock. Then the verse was revealed, "And do not say to one who offers you peace, 'You are not a believer,' seeking the transient gains of worldly life" [Nisa 4:94], referring to that flock.
حدثنا محمد بن عيسى حدثنا سفيان حدثنا عمرو بن دينار عن عطاء
لحق المسلمون رجلا في غنيمة له فقال السلام عليكم فقتلوه وأخذوا تلك الغنيمة فنزلت {ولا تقولوا لمن ألقى إليكم السلام لست مؤمنا تبتغون عرض الحياة الدنيا} تلك الغنيمة
Sourced from Bukhari, Book of Tafsir, Surah Nisa, chapter, "Do not say to one who greets you with peace, 'You are not a believer'," hadith 4591, and Muslim, Book of Tafsir, chapter on the tafsir of various verses, hadith 3025, from the hadith of Sufyan bin Uyayna, with this chain.