The Messenger of Allah ﷺ said, "Whoever withdraws his obedience and parts from the community, then dies, dies the death of the days of ignorance. Whoever rises against my community, striking down its righteous and its wicked alike, sparing no believer among them and honoring no covenant with one bound by a pledge, has nothing to do with me. Whoever fights under a banner of blind partisanship, calling to tribal loyalty or growing angry for the sake of tribal loyalty, and is killed, dies the death of the days of ignorance."
أخبرنا بشر بن هلال الصواف قال حدثنا عبد الوارث قال حدثنا أيوب عن غيلان بن جرير عن زياد بن رياح
قال رسول الله ﷺ من خرج من الطاعة وفارق الجماعة فمات مات ميتة جاهلية ومن خرج على أمتي يضرب برها وفاجرها لا يتحاشى من مؤمنها ولا يفي لذي عهدها فليس مني ومن قاتل تحت راية عمية يدعو إلى عصبية أو يغضب لعصبية فقتل فقتلة جاهلية
Muslim narrated it in Kitab al-Imarah, in the chapter on the obligation of remaining with the community of Muslims when disorders appear, etc., hadith no. 1848, from the hadith of Ayub through this same chain, and it is also found in Al-Kubra, hadith no. 3579.