Amr bin Abasah (may Allah be pleased with him) said: The Messenger of Allah (peace and blessings be upon him) led us in prayer beside a camel from the spoils. After saying the salam, he (peace and blessings be upon him) took some hair from the side of the camel, then said: "Not even this much of your spoils is lawful for me, except the one-fifth, and the one-fifth too is returned to you."
Imam al-Shafi'i (may Allah have mercy on him) said: The Messenger of Allah (peace and blessings be upon him) has passed away, may my father and mother be sacrificed for him, and may Allah and His angels send their blessings upon him. Our people of knowledge have differed concerning his (peace and blessings be upon him) share. Some said: It will be returned to the shares that Allah has mentioned. Some said: It will be spent at the discretion of the Imam, wherever he wishes, for Islam and the people of Islam. And some said: He will keep it for weapons and the like. What I prefer is that the Imam keeps it for the affairs of Islam and for the people of Islam, for weapons and the like, or to give as a reward to those who have rendered distinguished service in Islam, whether in war or outside a state of war. The Messenger of Allah (peace and blessings be upon him) spent it in this way: the Messenger of Allah (peace and blessings be upon him) gave to win hearts, gave in war, and in the year of Khaybar gave to his Companions from among the Muhajirun and the Ansar, to the needy and to people of merit, and most of them were needy; he gave all of them from his share. The Shaykh (may Allah have mercy on him) said: He (peace and blessings be upon him) also used to give to win hearts.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب قسم الفيء والغنيمة / 12943