Abu Hurairah reported,

The Messenger of Allah ﷺ said, "A prophet from among the prophets once camped beneath a tree, and an ant bit him. He ordered his belongings to be removed from under the tree, then commanded that the ant's nest be burned with fire. So Allah revealed to him, 'Was it not enough to punish a single ant?'"

Bukhari 3319

Sahih

حدثنا إسماعيل بن أبي أويس قال حدثني مالك عن أبي الزناد عن الأعرج

عن أبي هريرة رضي الله عنه

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

البخاري 3319صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Bukhari
Book
Beginning of creation
Chapter
Five vermin that may be killed in the Haram
Numbering
Darussalam 3319
Bukhari 3319