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 lives and property are protected from me, except by its rightful claim, and their reckoning is with Allah ."
أخبرنا محمد بن عبد الله بن المبارك قال حدثنا أبو معاوية ح وأنبأنا أحمد بن حرب قال حدثنا أبو معاوية عن الأعمش عن أبي صالح
قال رسول الله ﷺ أمرت أن أقاتل الناس حتى يقولوا لا إله إلا الله فإذا قالوها منعوا مني دماءهم وأموالهم إلا بحقها وحسابهم على الله عز وجل
Muslim narrated it in "Faith," chapter on the command to fight people until they say, "There is no god but Allah, Muhammad is the Messenger of Allah," etc., no. 35/21, from the hadith of Amash through this route. It is also in Kubra, no. 3438, and Tirmidhi said, no. 2606, hasan sahih.