Abu Hurairah reported,

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, 'No man shall follow me who has married a woman and wishes to consummate the marriage but has not yet done so, nor one who has built a house but has not yet raised its roof, nor one who has bought sheep or pregnant she-camels and is awaiting their offspring.'So he set out on the campaign, and he drew near 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 refused to consume them. He said, 'Among you is one who has taken from the spoils unlawfully. Let one man from each tribe pledge allegiance to me.' So they pledged to him, and the hand of one man stuck to his. He said, 'Among you is the one who took unlawfully. Let your tribe pledge allegiance to me.' So they pledged to him, and the hands of two or three men stuck to his. He said, 'Among you is the one who took unlawfully. You are the ones who took.'They then brought out for him something like the head of a cow made of gold. He placed it with the rest of the spoils on open ground, and the fire came and consumed them. War spoils were not made lawful for anyone before us. That was because Allah تبارك وتعالى saw our weakness and inability, so He made them lawful and pleasant for us."

Muslim 4555

Sahih

و حدثنا أبو كريب محمد بن العلاء حدثنا ابن المبارك عن معمر ح و حدثنا محمد بن رافع واللفظ له حدثنا عبد الرزاق أخبرنا معمر عن همام بن منبه قال هذا ما

حدثنا أبو هريرة

عن رسول الله ﷺ فذكر أحاديث منها وقال رسول الله ﷺ غزا نبي من الأنبياء فقال لقومه لا يتبعني رجل قد ملك بضع امرأة وهو يريد أن يبني بها ولما يبن ولا آخر قد بنى بنيانا ولما يرفع سقفها ولا آخر قد اشترى غنما أو خلفات وهو منتظر ولادها قال فغزا فأدنى للقرية حين صلاة العصر أو قريبا من ذلك فقال للشمس أنت مأمورة وأنا مأمور اللهم احبسها علي شيئا فحبست عليه حتى فتح الله عليه قال فجمعوا ما غنموا فأقبلت النار لتأكله فأبت أن تطعمه فقال فيكم غلول فليبايعني من كل قبيلة رجل فبايعوه فلصقت يد رجل بيده فقال فيكم الغلول فلتبايعني قبيلتك فبايعته قال فلصقت بيد رجلين أو ثلاثة فقال فيكم الغلول أنتم غللتم قال فأخرجوا له مثل رأس بقرة من ذهب قال فوضعوه في المال وهو بالصعيد فأقبلت النار فأكلته فلم تحل الغنائم لأحد من قبلنا ذلك بأن الله تبارك وتعالى رأى ضعفنا وعجزنا فطيبها لنا

مسلم 4555صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Muslim
Book
Jihad and expeditions
Chapter
Permissibility of spoils of war specifically for this nation
Numbering
Darussalam 4555
Muslim 4555