Sahih Muslim 1848 c
It has been narrated (through a different chain of transmitters) on the authority of Abu Huraira that the Messenger of Allah (ﷺ) said:
Whoever defects from obedience (to the Amir) and separates from the main body of the Muslim - and dies in that state - dies the death of one belonging to the days of jahiliyya . And he who is killed under the banner of a man who is blind (to the cause for which he is fighting), who gets flared up with family pride and fights for his tribe is not from my Ummah, and whosoever from my followers attacks my followers (indiscriminately) killing the righteous and the wicked of them, sparing not (even) those staunch in faith and fulfilling not his obligation towards them who have been given a pledge (of security), is not from me (i.e. is not my follower).
وَحَدَّثَنِي زُهَيْرُ بْنُ حَرْبٍ، حَدَّثَنَا عَبْدُ الرَّحْمَنِ بْنُ مَهْدِيٍّ، حَدَّثَنَا مَهْدِيُّ بْنُ مَيْمُونٍ، عَنْ غَيْلاَنَ بْنِ جَرِيرٍ، عَنْ زِيَادِ بْنِ رِيَاحٍ، عَنْ أَبِي هُرَيْرَةَ، قَالَ قَالَ رَسُولُ اللَّهِ صلى الله عليه وسلم ‏
"‏ مَنْ خَرَجَ مِنَ الطَّاعَةِ وَفَارَقَ الْجَمَاعَةَ ثُمَّ مَاتَ مَاتَ مِيتَةً جَاهِلِيَّةً وَمَنْ قُتِلَ تَحْتَ رَايَةٍ عُمِّيَّةٍ يَغْضَبُ لِلْعَصَبَةِ وَيُقَاتِلُ لِلْعَصَبَةِ فَلَيْسَ مِنْ أُمَّتِي وَمَنْ خَرَجَ مِنْ أُمَّتِي عَلَى أُمَّتِي يَضْرِبُ بَرَّهَا وَفَاجِرَهَا لاَ يَتَحَاشَ مِنْ مُؤْمِنِهَا وَلاَ يَفِي بِذِي عَهْدِهَا فَلَيْسَ مِنِّي ‏"‏ ‏.‏