The Messenger of Allah ﷺ said, "I have been commanded to fight the people until they say, 'There is no god but Allah.' Whoever says it has protected his life and property from me, except for what is due by right, and his reckoning is with Allah."
أخبرنا أحمد بن محمد بن المغيرة قال حدثنا عثمان عن شعيب عن الزهري ح و أخبرني عمرو بن عثمان بن سعيد بن كثير قال حدثنا أبي قال حدثنا شعيب عن الزهري قال حدثني سعيد بن المسيب أن
أن رسول الله ﷺ قال أمرت أن أقاتل الناس حتى يقولوا لا إله إلا الله فمن قالها فقد عصم مني نفسه وماله إلا بحقه وحسابه على الله
Bukhari narrated it in the Book of Jihad, chapter "The Prophet's ﷺ call to Islam and prophethood," hadith 2946, from the hadith of Shuayb through the same chain. It is also in Al-Kubra, hadith 4303.