On the day of Hunayn, the Prophet ﷺ gave preference to certain people in the distribution of spoils. He gave Aqra bin Habis a hundred camels, gave Uyayna the same, and gave a number of the noblemen of the Arabs, favoring them that day in the distribution.A man said, "By Allah, this distribution is not just, and the Face of Allah was not sought by it!"I said, "By Allah, I will inform the Prophet ﷺ." So I came to him and told him.He said, "Then who is just, if Allah and His Messenger are not just? May Allah have mercy on Musa. He was harmed with more than this, yet he remained patient."
لما كان يوم حنين آثر أناسا في القسمة، فأعطى الأقرع بن حابس مائة من الإبل، وأعطى عيينة مثل ذلك، وأعطى أناسا من أشراف العرب فآثرهم يومئذ في القسمة. قال رجل: والله إن هذه القسمة ما عدل فيها، وما أريد بها وجه الله! فقلت: والله لأخبرن النبي ﷺ، فأتيته فأخبرته، فقال: فمن يعدل إذا لم يعدل الله ورسوله، رحم الله موسى قد أوذي بأكثر من هذا فصبر.
Bukhari related it in the Book of the Obligation of Khumus (3150), and Muslim in the Book of Zakat (1062), both from Uthman bin Abu Shayba, who said, Jareer narrated to us, from Mansur, from Abu Waail, from Abdullah bin Masud, who said, and then he mentioned it, and their wording is the same.