Abu Hurairah reported,

It was narrated from the Messenger of Allah ﷺ, and he mentioned several hadith, among them that the Messenger of Allah ﷺ said, "One of the prophets stopped to rest beneath a tree, and an ant bit him. He ordered that his belongings be moved out from under it, then he ordered the ants' nest to be burned with fire. So Allah revealed to him, 'Why not just one ant?'"

Muslim 5851

Sahih

و حدثنا محمد بن رافع حدثنا عبد الرزاق أخبرنا معمر عن همام بن منبه قال هذا ما

حدثنا أبو هريرة

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

مسلم 5851صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Muslim
Book
Peace
Chapter
Prohibition of killing ants
Numbering
Darussalam 5851
Muslim 5851