Sayyiduna Abu Umamah al-Bahili (may Allah be pleased with him) asked Ubadah bin al-Samit (may Allah be pleased with him) about the spoils (anfal). At its end it says: When we disagreed and our conduct became bad, Allah took it out of our hands and returned it to the Messenger of Allah (peace and blessings be upon him). He (peace and blessings be upon him) divided it among the people equally. This was the way of fearing Allah and obeying Allah and the Messenger (peace and blessings be upon him), and of reconciliation among people. Allah Almighty says: "They ask you about the spoils of war. Say: The spoils of war belong to Allah and the Messenger, so fear Allah and set right the relations between you." [Surah al-Anfal: 1]
Ibn Ishaq said: I heard al-Zuhri (may Allah have mercy on him) say: Surah al-Anfal was revealed in its entirety concerning the people of Badr.
Imam al-Shafi'i (may Allah have mercy on him) said: All of the spoils belonged to the Messenger of Allah (peace and blessings be upon him); he (peace and blessings be upon him) divided them among the people, and included among them eight men from the Muhajirun and the Ansar who had not been present at the battle. In one place, seven or eight are mentioned.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب السير / 17986