Ibn Umar (may Allah be pleased with them both) said that the Prophet (peace and blessings be upon him) said: "Listening and obeying is obligatory upon every Muslim, whether he likes it or not, as long as the commander does not order disobedience (to Allah); in disobedience there is no listening and no obeying."
Hadith Referenceالسنن الكبرى للبيهقي / كتاب قتال أهل البغي / 16608