I heard the Messenger of Allah ﷺ say, "An ant bit one of the prophets, so he ordered the ants' colony to be burned, and it was burned. Allah then revealed to him, 'Because a single ant bit you, you destroyed an entire community that glorifies Me.'"
سمعت رسول الله ﷺ يقول: قرصت نملة نبيا من الأنبياء، فأمر بقرية النمل فأحرقت، فأوحى الله إليه: أن قرصتك نملة أحرقت أمة من الأمم تسبح.
Bukhari reported it in jihad (3019), and Muslim in salam (2241/151), both through the route of Yunus, from Ibn Shihab, from Saeed bin Musayab, that Abu Hurairah said, and he mentioned it.