Abu Hurairah reported,

The Prophet ﷺ said, "Whoever withdraws from obedience and separates from the community and then dies has died the death of the days of ignorance. Whoever fights under a blind banner, becoming angry for the sake of tribal partisanship, or calling to tribal partisanship, or supporting tribal partisanship, and is killed, his death is the death of the days of ignorance. Whoever rebels against my nation, striking down its righteous and its wicked alike, sparing none of its believers, and not honoring the pledge given to one with whom a covenant exists, he is not of me, and I am not of him."

Muslim 4786

Sahih

حدثنا شيبان بن فروخ حدثنا جرير يعني ابن حازم حدثنا غيلان بن جرير عن أبي قيس بن رياح

عن أبي هريرة

عن النبي ﷺ أنه قال من خرج من الطاعة وفارق الجماعة فمات مات ميتة جاهلية ومن قاتل تحت راية عمية يغضب لعصبة أو يدعو إلى عصبة أو ينصر عصبة فقتل فقتلة جاهلية ومن خرج على أمتي يضرب برها وفاجرها ولا يتحاشى من مؤمنها ولا يفي لذي عهد عهده فليس مني ولست منه

مسلم 4786صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Muslim
Book
Leadership
Chapter
Command to adhere to the community when tribulations appear and warning against callers to disbelief
Numbering
Darussalam 4786
Muslim 4786