Where the story is told

The Prophet ﷺ told this story, and Abu Hurayrah, may Allah be pleased with him, narrated it. It is found in Sahih al-Bukhari (3019 and 3319) and in Sahih Muslim (2241), where it is reported in more than one narration.

The hadith does not name the prophet, his people or the place where it happened. It only says that he was "one of the prophets".

The story in the hadith

In the first narration (Sahih al-Bukhari 3019, Sahih Muslim 2241), an ant stung one of the prophets, so he ordered the village of the ants to be burned. Allah then revealed to him, in the meaning: because one ant stung you, you burned a nation among the nations that glorify Allah? Sahih Muslim uses a word that means he destroyed them.

In the second narration (Sahih al-Bukhari 3319, Sahih Muslim 2241), a prophet stopped to rest under a tree and an ant stung him. He ordered his belongings to be taken out from under the tree, and then ordered the ants' home to be burned. Allah revealed to him: «فَهَلاَّ نَمْلَةً وَاحِدَةً». The meaning is: why not just the one ant that hurt you?

The hadith ends there. It does not tell what the prophet said or did after the revelation.

What the hadith does not tell us

We do not know which prophet this was, when he lived, or where. Some people say it was Sulayman, but nothing in the hadith says so, and it is better not to name him.

The hadith also does not say how many ants there were, or how the prophet answered. What we can say is only what the narrations give.

A different story: Sulayman and the ants in the Quran

The Quran tells a separate event in Surah an-Naml. Sulayman (Solomon) and his army came to the valley of the ants, and an ant said to the others to enter their homes so that they would not be crushed without noticing (Quran 27:18). Sulayman smiled at her words and asked Allah to help him be grateful for His favours (Quran 27:19).

This is a different story, and the hadith does not connect the two. What they share is the idea that the Quran and the Sunnah treat ants as creatures with a life and a community of their own. The Quran also says that everything glorifies Allah, though we do not understand their glorification (Quran 17:44).

What scholars said

Commentators on the hadith explain that the reproach was about the extent of the response. One ant hurt him, but a whole colony, including many that did nothing to him, was destroyed, and by fire. Some say that killing ants may have been permitted in that prophet's own law, so the reproach was about burning the many for the sake of the one. This is their understanding of the text, and the hadith does not say it directly.

In another hadith (Sahih al-Bukhari 3016), the Prophet ﷺ cancelled an order to burn two men, saying that none punishes with fire except Allah. Scholars differ in the details of what may be done about harmful insects, and this page does not give a ruling.

Lessons from this story

  • Mercy applies to all creatures. Even a small creature is part of Allah's creation, and the hadith says that it glorifies Allah.
  • Anger should not lead us to go further than the harm done. The prophet was hurt by one ant, but the response reached a whole colony.
  • Proportion matters: the reproach was not about the one ant, but about the many who did nothing.
  • Allah's correction is gentle and clear. The revelation is short, and it teaches without long explanation.
  • Not every detail needs to be known. The hadith keeps the prophet unnamed, and we take the lesson without guessing who he was.

General information for learning, not a fatwa. For your own situation, ask a qualified scholar.

Sources