The Messenger of Allah ﷺ said, "Whoever takes up arms against us is not one of us."
أن رسول الله ﷺ قال: من حمل علينا السلاح فليس منا.
Bukhari narrated it in the Book of Tribulations (7070) and Muslim in the Book of Faith (98), both through the route of Malik, from Nafi, from Ibn Umar, who mentioned it. It is also found in Muwatta Muhammad bin Hasan (866).