He was traveling with the Messenger of Allah ﷺ until, at a point along the road to Mecca, he stayed behind with some of his companions who were in a state of ihram, while he himself was not. He spotted a wild donkey, mounted his horse, then asked his companions to hand him his whip, but they refused. He asked them for his spear, and they refused again. So he took it himself, charged at the donkey, and killed it.Some of the Prophet's ﷺ companions ate from it, while others declined. When they caught up with the Messenger of Allah ﷺ, they asked him about it, and he said, "It is simply food that Allah has provided for you to eat."
أخبرنا قتيبة عن مالك عن أبي النضر عن نافع مولى أبي قتادة
أنه كان مع رسول الله ﷺ حتى إذا كان ببعض طريق مكة تخلف مع أصحاب له محرمين وهو غير محرم ورأى حمارا وحشيا فاستوى على فرسه ثم سأل أصحابه أن يناولوه سوطه فأبوا فسألهم رمحه فأبوا فأخذه ثم شد على الحمار فقتله فأكل منه بعض أصحاب النبي ﷺ وأبى بعضهم فأدركوا رسول الله ﷺ فسألوه عن ذلك فقال إنما هي طعمة أطعمكموها الله عز وجل
Narrated by Muslim, Hajj, chapter on the prohibition of hunting for one in the state of ihram for Hajj, hadith no. 57/1196, from Qutayba, and by Bukhari, Jihad, chapter on what has been said regarding spears, hadith no. 2914, from the hadith of Malik through this same chain. It also appears in Al-Kubra, hadith no. 3798, and in Muwatta (Yahya), 1/350.