Narrated Salama bin Al-Akwa: An infidel spy came to the Prophet, peace be upon him, while he was on a journey. The spy sat with the companions of the Prophet and started talking and then went away. The Prophet, peace be upon him, said (to his companions), “Chase and kill him.” So, I killed him. The Prophet, peace be upon him, then gave me the belongings of the killed spy.
(4: 286- O.B. Sahih Al-Bukhari)