We were sitting with the Messenger of Allah ﷺ in the Suffah while he was relating stories to us and reminding us, when a man came and whispered something to him.The Messenger of Allah ﷺ said, "Go and kill him."When the man turned to leave, the Messenger of Allah ﷺ called him back and asked, "Does he testify that there is no god but Allah?"The man replied, "Yes, Messenger of Allah."He said, "Go and let him go free, for I have only been commanded to fight people until they testify that there is no god but Allah. Once they do that, their blood and property become inviolable to me, except by its rightful claim."
إنا لقعود عند رسول الله ﷺ في الصفة، وهو يقص علينا، ويذكرنا، إذ جاء رجل فساره فقال: اذهبوا فاقتلوه، قال: فلما ولى الرجل دعاه رسول الله ﷺ قال: أيشهد أن لا إله إلا الله؟ قال الرجل: نعم، يا رسول الله، فقال: اذهبوا فخلوا سبيله، فإنما أمرت أن أقاتل الناس حتى يشهدوا أن لا إله إلا الله، فإذا فعلوا ذلك حرمت علي دماؤهم وأموالهم إلا بحقها.
Narrated by Nasai (3983), Ibn Majah (3929), and Ahmad (16163) - and this wording is his - all of them from the hadith of Abdullah bin Bakr Sahmi, who said, Hatim bin Abu Saghira narrated to us, from Numan bin Salim, that Amr bin Aws informed him, that his father Aws informed him, and he mentioned it. Its isnad is sahih, and the hadith has other routes, and what I have mentioned is the soundest of them.