The Holy Quran categorically declares that authority emanates from God and no individual has any inherent right over it. It is stated: 1
That is, O you who is being addressed, declare that: ‘O Allah, Lord of sovereignty, You give sovereignty to whomsoever You please; and You take away sovereignty from whomsoever You please. You exalt whomsoever You please and You abase whomsoever You please. In Your hand is all good. You surely have power to do all things.’
This verse reminds us that whenever an individual gains authority, it is a trust from God Himself. This does not mean that every ruler and person in authority — no matter how cruel, corrupt, foul or worthless he might be — is appointed by God as His representative. Rather this verse implies that circumstances that lead one to gain authority are created by God. Thus, if someone attains authority, it is due to him taking advantage of God’s created circumstances.
Since authority comes from God, anyone who gains authority or power in this world can at most consider himself as a subordinate and trustee of God. He cannot consider himself to be the absolute ruler or authority. The ultimate authority and decision rests with God Almighty. Any ruler, king, dictator or parliamentarian, who is entrusted with the affairs of a state, is answerable before God for the laws he enacts in this world. If laws promote things that God has forbidden or prohibit things that God has ordained, then such rulers will stand guilty before God Almighty just as insubordinate and rebellious servant is made to stand before his master. Regardless of their status — whether they be a king, dictator or a parliamentarian — they will surely be punished by God Almighty for their actions.
Thus the above-quoted verse does not imply that every person who gains authority is appointed by God Himself. Instead, it means that if a person is given authority within his circle of influence, he must rule within the limits prescribed by God Himself — the ultimate authority. Doing otherwise would be considered sinful. It is true, however, that under certain circumstances, God does directly appoint people in authority, who are noble and just, but their rule is spiritual not worldly.
1 Surah Al-e-‘Imran, 3:27, (publishers)