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 right, and their reckoning is with Allah."
حدثنا أسود أخبرنا أبو بكر عن عاصم عن أبي صالح
قال رسول الله ﷺ أمرت أن أقاتل الناس حتى يقولوا لا إله إلا الله فإذا قالوها عصموا مني دماءهم وأموالهم إلا بحقها وحسابهم على الله
Its chain of transmission is sahih, having been mentioned repeatedly before. It was narrated by the leading scholars, Bukhari 1/13 in the Book of Faith, chapter "If they repent and establish prayer," Muslim 1/52 no. 21 in the Book of Faith, chapter "The command to fight people until they say, 'There is no god but Allah,'" Abu Dawud 2640 and 1556, Tirmidhi 2606 and 2607, Nasai 5/14 and 7/77, Ibn Majah 71, Darimi 2/218, and Abdul-Razzaq 6916.