It is obligatory for the army to obey their commander, except in a command to disobey Allah
➊ يَا أَيُّهَا الَّذِينَ آمَنُوا أَطِيعُوا اللَّهَ وَأَطِيعُوا الرَّسُولَ وَأُولِي الْأَمْرِ مِنكُمْ
“O you who believe! Obey Allah and obey the Messenger, and obey those in authority among you.”
➋ حَتَّىٰ إِذَا فَشِلْتُمْ وَتَنَازَعْتُمْ فِي الْأَمْرِ وَعَصَيْتُم
“Until, when you lost courage and fell into dispute over the matter and disobeyed (the commander).”
➌ Abu Hurayrah (may Allah be pleased with him) narrates that the Messenger of Allah ﷺ said:
من أطاعني فقد أطاع الله ومن عصاني فقد عصى الله ومن يطع الأمير فقد أطاعنى ومن يعص الأمير فقد عصاني
“Whoever obeyed me has indeed obeyed Allah, and whoever disobeyed me has disobeyed Allah, and whoever disobeyed the commander has disobeyed me.”
➍ Ibn Abbas (may Allah be pleased with them both) says regarding this verse:
أَطِيعُوا اللَّهَ وَأَطِيعُوا الرَّسُولَ وَأُولِي الْأَمْرِ مِنكُمْ
It was revealed about Abdullah ibn Hudhafah (may Allah be pleased with him), whom the Messenger of Allah ﷺ had sent out with a small detachment.
➎ Ali (may Allah be pleased with him) says that the Prophet ﷺ dispatched a small army and appointed an Ansari Companion (Abdullah ibn Hudhafah, may Allah be pleased with him) as its commander:
و أمرهم أن يطيعونه
“And he commanded the soldiers that all of them obey their commander.”
Then the commander became angry for some reason and asked his soldiers: Did the Messenger of Allah ﷺ not command you to obey me? They all said: “Yes,” he did. (The commander said:) Then all of you gather firewood. They gathered firewood, and the commander ordered them to set fire to it, and they set it alight. Then he ordered that all of them jump into it. The soldiers were just about to jump when some of them held back others and said: We came to the Messenger of Allah ﷺ only out of fear of this very fire. While these words were being exchanged, time passed and the fire died down, and after that the commander’s anger also cooled. When news of this incident reached the Messenger of Allah ﷺ, he ﷺ said: “Had these people jumped into it, they would never have come out of it until the Day of Resurrection.” And he said:
لا طاعة فى معصية الله إنما الطاعة فى المعروف
“There is no obedience to the commander in disobedience to Allah; obedience is only in what is good.”