Anas bin Malik reported,

A group of men from the tribe of Ukl came to the Prophet ﷺ, and the climate of Madinah did not agree with them. So the Prophet ﷺ told them to go out to the camels kept for charity and drink of their urine and milk. They did so, but then they killed the herdsman and drove the camels away.The Prophet ﷺ sent men after them, and they were brought back. He had their hands and feet cut off, and their eyes branded with heated nails, and he did not cauterize their wounds but left them until they died.Then Allah عز وجل revealed, "The recompense of those who wage war against Allah and His Messenger" [Maidah 5:33], and the rest of the verse.It was also said that they had killed the herdsman.

Nasai 4031

Sahih

أخبرنا إسحق بن منصور قال حدثنا محمد بن يوسف قال حدثنا الأوزاعي قال حدثني يحيى بن أبي كثير قال حدثني أبو قلابة عن أنس قال قدم على رسول الله ﷺ ثمانية نفر من عكل فذكر نحوه إلى قوله لم يحسمهم وقال قتلوا الراعي

النسائي 4031صحيح
Contents
Reference
Commentary
Ayat
Collection
Sunan Nasai Sughra
Book
Prohibition of bloodshed
Chapter
Interpretation of Allah عز وجل saying, "The only recompense of those who wage war against Allah and His Messenger and strive to make mischief in the land is that they be killed or crucified or that their hands and feet be cut off on opposite sides or that they be banished from the land," and concerning whom it was revealed, and mention of the differences in the wordings of the narrators of the report of Anas bin Malik regarding it
Numbering
Darussalam 4031
Nasai 4031