On the day of Hunayn, the Prophet ﷺ favored certain people in the distribution of spoils. He gave Aqra bin Habis a hundred camels, gave Uyayna the same, and gave a number of Arab nobles, 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, "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 was patient."
لما كان يوم حنين آثر أناسا في القسمة، فأعطى الأقرع بن حابس مائة من الإبل، وأعطى عيينة مثل ذلك، وأعطى أناسا من أشراف العرب، فآثرهم يومئذ في القسمة. فقال رجل: والله إن هذه القسمة ما عدل فيها، وما أريد بها وجه الله! فقلت: والله لأخبرن النبي ﷺ فأتيته فأخبرته، فقال: فمن يعدل إذا لم يعدل الله ورسوله، رحم الله موسى قد أوذي بأكثر من هذا فصبر.
Bukhari narrated it in "The Obligation of Khumus" (3150), and Muslim in "Zakat" (1062), both from the hadith of Jareer, from Mansur, from Abu Waail, from Abdullah, and he related it, with their wording being identical.