The Messenger of Allah ﷺ said, "Whoever takes up arms against us is not one of us."
حدثنا معتمر عن عبيد الله عن نافع
قال رسول الله ﷺ من حمل علينا السلاح فليس منا
Its isnad is sahih. It was also narrated by Malik, the two Shaykhs, Nasai, and Ibn Majah, as mentioned in Jami Saghir 8647.