In the past, Muslim jurists warned against fighting against rulers. This is based on a well established rule in Islam stating that “Fending off smaller harm must not result in creating a greater harm.” So, one of the conditions that should be met in forbidding evil is that it must not lead to inflicting greater harm. That is why the Prophet, peace and blessings be upon him, ordered us to be patient and endure the oppression and injustice of despotic rulers, in order to preserve the unity of the Muslim Ummah, and to obey the rulers except if their obedience would result in disobeying Allah.
Ibn `Abbas, may Allah be pleased with him, quoted the Prophet, peace and blessings be upon him, as saying: “If someone notices something he disapproves of in the manners of his Muslim ruler, he should be patient, for whoever turns away from the Muslim community even for a short span of time and then dies, he will die as those who died in the Pre-Islamic era of ignorance (as rebellious sinners).” (Reported by Al-Bukhari and Muslim)
The theme of this Hadith is that a great caution should be shown in criticizing policy adopted by tyrants for this may spark the fire of separation and disunity in the Muslim Ummah.
The prominent Muslim scholar, Dr. `Ali Jum`ah, professor of Usul-ul-Fiqh (Principles of Islamic Jurisprudence), Al-Azhar University, states: The Prophet, peace and blessings be upon him, described the Muslim as intelligent and prudent. In another Hadith, he, peace and blessings be upon him, described the Muslim as “the one who is aware of his conditions and takes into consideration the circumstances of his time.”(Reported by IbnHibban.)
accordingly, it is not right, at this crucial time that we need to defend the Muslim nation from those who plot against it, to be divided and each one of us fighting against the other. On the contrary, we want to join hands and put the heads together and stand one hand, rulers and subjects, against the wicked conspiracy against Islam and Muslims.
the Prophet, peace and blessings be upon him, said: “Religion (Islam) is (to disseminate) sincere advice. It was asked, “For who?” The Prophet said: “For the sake of Allah, the Prophet, and the Muslim leaders and the public.”
So, we should gather the whole Ummah, rulers and subjects, on one word, and be patient with a dissident until he gets back to the right track without causing separation or kindling the fire of sedition.
We should strive hard to help the oppressed have their rights restored back instead of killing each other or usurping one another’s property. Allah Almighty says: “And he unto whom wisdom is given, he truly hath received abundant good.” (Al-Baqarah: 269)

Shedding more light on this thorny issue, Sheikh Muhammad Saleh Al-Munajjid, a prominent Saudi Islamic lecturer and author states:

The basic comprehensive principle of Shari`ah is that it is not permitted to remove an evil by means of a greater evil; evil must be warded off by that which will remove it or reduce it. Warding off evil by means of a greater evil is not permitted according to the scholarly consensus (Ijma`) of the Muslims.
If removing a despotic ruler, who is openly committing Kufr, is possible, in the sense that it will pave way for a good and righteous person to replace the incumbent one without that leading to greater trouble for Muslims then that is okay.
But if rebellion would result in greater trouble and lead to chaos, oppression and taking the lives of people with no right, and other forms of major evil, then that is not permitted. Rather it is essential to be patient and to hear and obey in matters of good, and to offer sincere advice to the authorities.
Besides, one should pray for those rulers to be guided to the way that pleases Allah and bring welfare to the subjects. This is the correct way which should be followed, for it serves the general interests of the Muslims, helps reduce evil and increase good and makes peace prevail in society.