The Messenger of Allah ﷺ mentioned several hadiths, among them this one. The Messenger of Allah ﷺ said, "One of the prophets went out on a military campaign and said to his people, 'Let no man follow me who has married a woman and intends to consummate the marriage but has not yet done so, nor any man who has built a house but has not yet raised its roof, nor any man who has bought sheep or pregnant she-camels and is awaiting their offspring.'So he set out on the campaign and approached the town around the time of the afternoon prayer, or close to it. He said to the sun, 'You are under command, and I am under command. Allah, hold it back for me a little.' So it was held back for him until Allah granted him victory.They gathered what they had taken as spoils, and a fire came forward to consume it, but it refused to consume them. He said, 'There is misappropriated booty among you. Let one man from each tribe pledge allegiance to me.' So they pledged allegiance to him, and the hand of one man stuck to his hand. He said, 'The misappropriated booty is among you. Let your tribe pledge allegiance to me.' So they pledged allegiance to him, and the hands of two or three men stuck to his. He said, 'The misappropriated booty is with you. You have taken it.'So they brought out for him something like the head of a cow made of gold. They placed it with the rest of the spoils on the open ground, and the fire came and consumed it.Spoils of war were not made lawful for anyone before us. That was because Allah saw our weakness and inability, so He made them lawful for us."
عن رسول الله ﷺ فذكر أحاديث منها: وقال رسول الله ﷺ: غزا نبي من الأنبياء فقال لقومه: لا يتبعني رجل قد ملك بضع امرأة، وهو يريد أن يبنى بها، ولما يبن، ولا آخر قد بنى بنيانا ولما يرفع سقفها، ولا آخر قد اشترى غنما أو خلفات وهو منتظر ولادها، قال: فغزا فأدنى للقرية حين صلاة العصر، أو قريبا من ذلك، فقال للشمس: أنت مأمورة، وأنا مأمور، اللهم احبسها علي شيئا، فحبست عليه حتى فتح الله عليه، قال: فجمعوا ما غنموا فأقبلت النار لتأكله، فأبت أن تطعمه، فقال: فيكم غلول، فليبايعني من كل قبيلة رجل فبايعوه، فلصقت يد رجل بيده، فقال: فيكم الغلول، فلتبايعني قبيلتك، فبايعته قال: فلصقت بيد رجلين أو ثلاثة، فقال: فيكم الغلول، أنتم غللتم، قال: فأخرجوا له مثل رأس بقرة من ذهب، قال: فوضعوه في المال، وهو بالصعيد، فأقبلت النار فأكلته، فلم تحل الغنائم فلم تحل الغنائم لأحد من قبلنا، ذلك بأن الله تبارك وتعالى رأى ضعفنا وعجزنا، فطيبها لنا.
Bukhari narrated it in the Book of the Obligation of the Fifth (3124), and Muslim in the Book of Jihad and Expeditions (1747), both by way of Ibn Mubarak, and Muslim added Abdul-Razzaq, from Mamar, from Hammam bin Munabbih, from Abu Hurairah, and he related it.It is well known that the one for whom the sun was held back was Yusha bin Nun. Immediately after the death of Musa , Yusha bin Nun began making rapid preparations to cross the Jordan River. During this assault, Yusha bin Nun commanded the sun to stand still, saying, as recorded in the Old Testament, "Sun, stand still over Gibeon, and moon, over the valley of Aijalon" [Book of Joshua 12:10]. The word for "stand still" means "remain in place," so the sun stopped from setting and the moon stopped from rising, until Banu Israil were able to cross the Jordan River during the daytime and conquer the city of Jericho, which was the gateway into the Holy Land.His saying, "so he drew near to the town," means that the conquest of this town, namely Jericho, drew near. It is said of a she-camel, "she has drawn near," when her time to give birth approaches, and this expression is not used for anything other than a she-camel.