The Messenger of Allah ﷺ said, "I have been commanded to fight the people until they say, 'There is no god but Allah.' Once they say it, their blood and property are protected from me, except by its rightful claim, and their reckoning is with Allah the Exalted."
حدثنا مسدد حدثنا أبو معاوية عن الأعمش عن أبي صالح
قال رسول الله ﷺ أمرت أن أقاتل الناس حتى يقولوا لا إله إلا الله فإذا قالوها منعوا مني دماءهم وأموالهم إلا بحقها وحسابهم على الله تعالى
Narrated by Muslim, in the Book of Faith, chapter on the command to fight people until they say, "There is no god but Allah, Muhammad is the Messenger of Allah" ... etc, hadith no. 21, from the hadith of Amash. And Tirmidhi, hadith no. 2606, from the hadith of Abu Muawiya al-Dareer with the same wording, and he said, hasan sahih.