A spy from the polytheists came to the Prophet ﷺ while he was on a journey. He sat among the Prophet's companions, talking with them, and then slipped away.The Prophet ﷺ said, "Pursue him and kill him."So he killed him, and the Prophet ﷺ awarded him the spy's belongings as spoils.
أتى النبي ﷺ عين من المشركين، وهو في سفر، فجلس عند أصحابه يتحدث، ثم انفتل، فقال النبي ﷺ: اطلبوه واقتلوه، فقتله، فنقله سلبه.
Bukhari related it in jihad and expeditions (3051), and Muslim in jihad and expeditions (1754: 45), both by way of Iyas bin Salama bin Akwa, from his father, who narrated it. The wording is Bukhari's, and Muslim's version is longer.