Imām Ibn al-Qayyim [d. 751 AH] said:
يَا أَيُّهَا الَّذِينَ آمَنُوا أَطِيعُوا اللَّهَ وَأَطِيعُوا الرَّسُولَ وَأُولِي الْأَمْرِ مِنكُمْ ۖ فَإِن تَنَازَعْتُمْ فِي شَيْءٍ فَرُدُّوهُ إِلَى اللَّهِ وَالرَّسُولِ إِن كُنتُمْ تُؤْمِنُونَ بِاللَّهِ وَالْيَوْمِ الْآخِرِ ۚ ذَٰلِكَ خَيْرٌ وَأَحْسَنُ تَأْوِيلًا ﴿٥٩﴾
“O you who have believed, obey Allāh and obey the Messenger and those in authority over you. And if you disagree among yourselves over anything then refer it back to Allāh and the Messenger if you truly believe in Allāh and the Last Day. That is better (conduct) and (leads to) the most excellent outcome.”
Allāh has commanded obedience to Himself and His Messenger [ﷺ]. [In the verse], the [commanding] verb is repeated to denote that obedience to the Messenger [ﷺ] is obligatory, in isolation, without the requirement to compare what he has ordered with what is in the Book [of Allāh]. Rather, should he issue a command, it must be followed on all occasions whether what he has ordered be present in the Book [of Allāh] or absent. For he has been given the Book [of Allāh] and that which is similar to it.
[However], we are not commanded to follow those in authority in isolation. Rather, [in the verse] the commanding verb is removed [before ‘those in authority’]. [Allāh has] made obedience to them delineate from obedience to the Messenger [ﷺ] in order to bring attention to the fact that they are only obeyed as it follows on from obedience to the Messenger [ﷺ]. So whomever from among them orders obedience to the Messenger [ﷺ], it is obligatory to be obedient to his command. Whomsoever from among them commands with that which is contradictory to what the Messenger [ﷺ] has come with, we ignore them in that order and we refuse to follow it.
As it comes in the authentic narration from him [ﷺ]: “There is no obedience to the creation in that which is disobedient to the Creator.”
And he [ﷺ] also said: “Obedience is only in that which is good.”
He [ﷺ] also said concerning those who have been given authority: “Whomsoever from among them orders you with that which is disobedient to Allāh, ignore [that order] and do not follow it.”
He [ﷺ] has also related to us the story of those who desired to enter the fire when they were ordered by their ruler to do so. He [ﷺ] said [concerning them]: “If they were to enter it, they would never leave it” even considering their entry was only in response to the command of the one in authority over them, under the presumption that this action was obligatory on them. When they showed deficiency in their exerted effort to follow the truth, and were quick to obey one who commanded them with that which is disobedient to Allāh, and they took the general order of obedience to mean other than what was intended by the one issuing the order [ﷺ], along with the knowledge that his dīn stipulated other than it, they thus were deficient in their strife [to reach the truth] and keen to throw themselves into punishment and ruin without confirmation or clarity. Could such actions ever be considered obedience to Allāh and His Messenger [ﷺ]? So what is the supposition concerning those who would obey that which is in gross contradiction to what Allāh has sent his Messenger [ﷺ] with? Then, Allāh has ordered with returning that which the Muslims argue with one another concerning to Allāh if they are indeed believers. He relates to them that this is better for them in this worldly life, and leads to the most excellent of outcomes in the end of such matters.
Source: Iʿlām al-Muwaqiʿīn: 89-91
Translated by: Riyāḍ al-Kanadī