The Messenger of Allah ﷺ said, "I have been commanded to fight the people until they say, 'There is no god but Allah.' When they say, 'There is no god but Allah,' their blood and their property become protected from me, except for what is rightfully due, and their reckoning rests with Allah."Then he recited, "So remind them, for you are only one who reminds. You have no power to compel them" [Ghashiyah 88:21–22].
قال رسول الله ﷺ: أمرت أن أقاتل الناس حتى يقولوا: لا إله إلا الله، فإذا قالوا: لا إله إلا الله، عصموا منى دماءهم وأموالهم إلا بحقها، وحسابهم على الله. ثم قرأ: {فذكر إنما أنت مذكر لست عليهم بمصيطر}
Muslim narrated it in the Book of Iman (21) through multiple routes from Sufyan, from Abu Zubayr, from Jabir.