Narrated Ali: The Prophet, peace be upon him, sent a detachment under the command of a man from the Ansar and ordered the soldiers to obey him. He (the commander) became angry (at some time) and said, “Didn’t the Prophet, peace be upon him, order you to obey me?” They replied, ‘Yes.” He said, “Collect fire-wood for me.” So they collected it. He said, “Make a fire.” When they made it, he said, “Enter it (i.e. the fire).”
So they intended to do that and started holding each other and saying, “We have run towards the Prophet, peace be upon him, from the fire.” They kept on saying that till the fire was extinguished and the anger of the commander abated. When the news reached the Prophet, peace be upon him, he said, “If they had entered it (i.e. the fire), they would not have come out of it till the Day of Resurrection. Obedience (to somebody) is required when he enjoins (the doing of what is good) Al-Ma’roof.”
(5: 629- O.B. Sahih Al-Bukhari)