Sayyiduna Anas bin Malik and Sayyiduna Abu Sa'id al-Khudri (may Allah be pleased with them both) narrate from the Prophet (peace and blessings be upon him): "Soon there will be disagreement and division in my Ummah: a people whose speech is good and whose deeds are evil. They will recite the Qur'an, but it will not go beyond their collarbones. They will pass out of the religion as an arrow passes out of the game, and they will not return until the arrow returns to its notch. They are the worst of creation. Glad tidings to those who are martyred fighting them or who kill them. They will call to the Book of Allah, yet they have nothing to do with it. Whoever fights them will be closer to Allah than them." It was asked: What will be their sign? He said: "Shaving the head."
Imam al-Shafi'i (may Allah have mercy on him) took his evidence for fighting rebels from this verse: "And if two groups of the believers fight, then 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. And if it returns, then make peace between them with justice and act equitably; indeed, Allah loves those who act equitably." [Surah al-Hujurat: 9]
Hadith Referenceالسنن الكبرى للبيهقي / كتاب قتال أهل البغي / 16703