Imam al-Shafi'i (may Allah have mercy on him), in his earlier (school), drew evidence from this verse: "And if two groups of the believers fight one another, make peace between them; but if one of them transgresses against the other, then fight the one that transgresses until it returns to the command of Allah Almighty." [Surah al-Hujurat: 9]
Thus Allah, blessed be His name, permitted fighting the rebellious group when it refuses to return (to the truth).
He said: "And the Messenger of Allah (peace and blessings be upon him) encouraged fighting the people of rebellion."
And he cited the hadiths that we mentioned at the beginning of this book, and we present them here with other chains.
Sayyiduna Abu Sa'id al-Khudri (may Allah be pleased with him) said that the Prophet (peace and blessings be upon him) said: "My ummah will split into two groups, and from between them a group will break away (from the religion); it will be killed by whichever of the two groups is closer to the truth."
Hadith Referenceالسنن الكبرى للبيهقي / كتاب قتال أهل البغي / 16779