Military Expeditions led by the Prophet (pbuh) (Al-Maghaazi)
Bukhari :: Book 5 :: Volume 59 :: Hadith 629
Narrated 'Ali:
The Prophet sent a Sariya under the command of a man from the Ansar and ordered the soldiers to obey him. He (i.e. the commander) became angry and said "Didn't the Prophet 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 run towards (i.e. take refuge with) the Prophet from the fire." They kept on saying that till the fire was extinguished and the anger of the commander abated. When that news reached the Prophet 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 what is good."