Jami` at-Tirmidhi, Book 47, Hadith 3365 (In-Book)

Narrated Abu Hurairah: that the Prophet said: "None of the black heads (meaning the Children of Adam since (most of) their heads are black) before you partook of spoils of war, but fire from the heavens would be sent down upon them, consuming them." Sulaiman (one of the narrators) said "No one says this except for Abu Hurairah now. "So on the day of Badr when they had the spoils of war before it was made lawful for them, Allah [Most High] revealed: Were it not a previous ordainment from Allah, a severe torment would have touched you for what you took."

حَدَّثَنَا عَبْدُ بْنُ حُمَيْدٍ، أَخْبَرَنِي مُعَاوِيَةُ بْنُ عَمْرٍو، عَنْ زَائِدَةَ، عَنِ الأَعْمَشِ، عَنْ أَبِي صَالِحٍ، عَنْ أَبِي هُرَيْرَةَ، عَنِ النَّبِيِّ صلى الله عليه وسلم قَالَ ‏"‏ لَمْ تَحِلَّ الْغَنَائِمُ لأَحَدٍ سُودِ الرُّءُوسِ مِنْ قَبْلِكُمْ كَانَتْ تَنْزِلُ نَارٌ مِنَ السَّمَاءِ فَتَأْكُلُهَا ‏"‏ ‏.‏ قَالَ سُلَيْمَانُ الأَعْمَشُ فَمَنْ يَقُولُ هَذَا إِلاَّ أَبُو هُرَيْرَةَ الآنَ فَلَمَّا كَانَ يَوْمُ بَدْرٍ وَقَعُوا فِي الْغَنَائِمِ قَبْلَ أَنْ تَحِلَّ لَهُمْ فَأَنْزَلَ اللَّهُ تَعَالَى ‏:‏ ‏(‏لَوْلاَ كِتَابٌ مِنَ اللَّهِ سَبَقَ لَمَسَّكُمْ فِيمَا أَخَذْتُمْ عَذَابٌ عَظِيمٌ ‏)‏ قَالَ أَبُو عِيسَى هَذَا حَدِيثٌ حَسَنٌ صَحِيحٌ غَرِيبٌ مِنْ حَدِيثِ الأَعْمَشِ ‏.‏

sunnah.com