The Messenger of Allah ﷺ said, "I have been commanded to fight the people until they testify that there is no god but Allah and that Muhammad is the Messenger of Allah, establish the prayer, and pay the zakat. If they do so, their blood and wealth are protected from me, except for what Islam rightfully requires, and their reckoning is with Allah."
أن رسول الله ﷺ قال: أمرت أن أقاتل الناس حتى يشهدوا أن لا إله إلا الله وأن محمدا رسول الله، ويقيموا الصلاة، ويؤتوا الزكاة، فإذا فعلوا ذلك عصموا مني دماءهم وأموالهم إلا بحق الإسلام وحسابهم على الله.
Bukhari narrated it in the Book of Faith (25) and Muslim in the Book of Faith (22), both through the route of Shubah, from Waqid bin Muhammad bin Zayd bin Abdullah bin Umar, who said, "I heard my father narrating from Ibn Umar, that the Messenger of Allah ﷺ said," and he mentioned it.