Salama b. al-Akwa‘ said:
A spy of the polytheists who came to the Prophet when he was on a journey sat and talked with his companions and afterwards withdrew. The Prophet then said, “Look for him and kill him,” so I killed him and the Prophet gave me the spoil taken from him.
(Bukhari and Muslim.)