حَدَّثَنَا وَهْبُ بْنُ بَقِيَّةَ، قَالَ أَخْبَرَنَا خَالِدٌ، عَنْ دَاوُدَ، عَنْ عِكْرِمَةَ، عَنِ ابْنِ عَبَّاسٍ، قَالَ قَالَ رَسُولُ اللَّهِ صلى الله عليه وسلميَوْمَ بَدْرٍ ‏"‏ مَنْ فَعَلَ كَذَا وَكَذَا فَلَهُ مِنَ النَّفْلِ كَذَا وَكَذَا ‏"‏ قَالَ فَتَقَدَّمَ الْفِتْيَانُ وَلَزِمَ الْمَشْيَخَةُ الرَّايَاتِ فَلَمْ يَبْرَحُوهَا فَلَمَّا فَتَحَ اللَّهُ عَلَيْهِمْ قَالَتِ الْمَشْيَخَةُ كُنَّا رِدْءًا لَكُمْ لَوِ انْهَزَمْتُمْ لَفِئْتُمْ إِلَيْنَا فَلاَ تَذْهَبُوا بِالْمَغْنَمِ وَنَبْقَى فَأَبَى الْفِتْيَانُ وَقَالُوا جَعَلَهُ رَسُولُ اللَّهِ صلى الله عليه وسلم لَنَا فَأَنْزَلَ اللَّهُ ‏‏{‏ يَسْأَلُونَكَ عَنِ الأَنْفَالِ قُلِ الأَنْفَالُ لِلَّهِ ‏}‏ إِلَى قَوْلِهِ ‏‏{‏ كَمَا أَخْرَجَكَ رَبُّكَ مِنْ بَيْتِكَ بِالْحَقِّ وَإِنَّ فَرِيقًا مِنَ الْمُؤْمِنِينَ لَكَارِهُونَ ‏}‏ يَقُولُ فَكَانَ ذَلِكَ خَيْرًا لَهُمْ فَكَذَلِكَ أَيْضًا فَأَطِيعُونِي فَإِنِّي أَعْلَمُ بِعَاقِبَةِ هَذَا مِنْكُمْ‏.‏
Translation
Narrated Abdullah ibn Abbas

The Messenger of Allah (ﷺ) said on the day of Badr, "Whoever does such-and-such, will have such-and-such from the spoils." The young men came forward, and the old men stayed by the banners and did not leave them. When Allah granted them victory, the old men said, "We were your support; had you been defeated, you would have retreated to us. Do not go off with the spoils and leave us behind." But the young men refused and said, "The Messenger of Allah (ﷺ) assigned it to us." Then Allah revealed:

"They ask you concerning the spoils of war. Say: The spoils are for Allah and the Messenger..."
up to His saying:
"As your Lord brought you out of your house with the truth, and indeed a party of the believers were reluctant."
He says: That was better for them, so likewise obey me, for I know the consequence of this among you better than you do.