Hadith 4122

He reported God’s messenger as saying that when a prophet was stung by an ant he ordered a colony of ants to be burned, and God most high revealed to him, "Because an ant stung you you have burned a community which glorifies me." (Bukhari and Muslim.)

وَعَنْهُ قَالَ: قَالَ رَسُولُ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ: " قَرَصَتْ نَمْلَةٌ نَبِيًّا من الأنبياءِ فأمرَ بقربةِ النَّمْلِ فَأُحْرِقَتْ فَأَوْحَى اللَّهُ تَعَالَى إِلَيْهِ: أَنْ قَرَصَتْكَ نَمْلَةٌ أَحْرَقْتَ أُمَّةً مِنَ الْأُمَمِ تُسَبِّحُ؟ "

Reference: 5641220
In-book reference: Book 20, Hadith 4122