The Messenger of Allah ﷺ said, "I have been commanded to fight people until they say, 'There is no god but Allah.' Whoever says, 'There is no god but Allah' has protected his life and property from me, except for what is due upon them, and his reckoning rests with Allah."
قال رسول الله ﷺ: أمرت أن أقاتل الناس حتى يقولوا: لا إله إلا الله، فمن قال: لا إله إلا الله فقد عصم مني نفسه وماله إلا بحقه وحسابه على الله.
Bukhari narrated it in the Book of Jihad and Expeditions (2946), and Muslim in the Book of Faith (21:33), through two routes from Zuhri, from Saeed bin Musayab, from Abu Hurairah, who mentioned it.