Thus, Abu Zakariyya Yahya ibn Sharaf an-Nawawi...
Thus, Abu Zakariyya Yahya ibn Sharaf an-Nawawi (631/1233-676/1277) writes: Do not fight against those in authority in matters of governance, nor raise objections against them except when you observe them committing things which you know are definitely against Islam. If you see them doing such things regard it bad for them and speak the truth wherever you may be, but rising against them or fighting is prohibited by the consensus of Muslims. (Sharh Sahih Muslim, vol.2, p.125.
In agreement with this view, see also, al-Qadi Abu Bakr Muhammad ibn at-Tayyib al-Baqillani [338/950 - 403/1013], the Ash'arite great scholar, in at- Tamhid, p.186; and Sa'du'd-Din Mas'ud ibn 'Umar at-Taftazani [712/1312 - 793/1390] in Sharh al-Maqasid, vol.2, p.272) Muhammad ibn 'Abd al-Karim ash- Shahrastani writes: Whoever rises against the true Imam, by the unanimity of opinion of the (Muslim) community, is known as a Kharijite, the deviator.
The same is the case of rising, during the days of the companions, against the rightful Imams, or even after them against those who followed them in virtue. (al-Milal wa'n-nihal, vol.1, p.114) There is no doubt that Mu'awiyah's action was the result of uprising and revolt, and to take up arms for the purpose of stopping the advance of the one who revolts is not to be regarded as being against any code of peacefulness or peace-loving.
Rather, it is a natural right of the oppressed; and if he is deprived of this right then there will remain no way of preventing oppression and tyranny or of safeguarding rights in the world. That is why Allah has permitted taking up arms against rebels.
Thus, Allah says: And if two parties of the believers fall into a quarrel (among themselves), restore ye peace between them two; but if one of the two transgresseth against the other, (then) fight ye (all against) that which transgresseth until it complieth with the command of Allah; and if it complieth then restore ye peace between the two with justice, and act ye justly; Verily, Allah loveth the just ones.
(Qur'an, 49:9) It was the first plea to which Amir al-mu'minin pointed out by saying, "By the Grace of Allah you are in the right," but even after exhaustion of this plea he prevented his army from taking the initiative in fighting, because he wished that the initiative should not be from his side and that he should take up the sword only in defence.