Is it haram to kill spiders and insects?

Question 1093

Question

Is it a sin in Islam to kill spiders, ants, or other insects, and did a spider protect the Prophet in the cave?

Summary of answer

Killing a spider or insect is not haram in itself. The Prophet ﷺ permitted killing harmful creatures, while he forbade killing ants and bees without reason and forbade burning any creature. The Quran honors the ant who warned her colony and a whole sūra bears the spider's name. The story of a spider's web over the cave comes from a later report with a disputed chain. Spare what is harmless, and remove what harms quickly and kindly.

Answer

الحمد لله Praise be to Allah.

A carved wooden pavilion with a green-tiled roof and stucco arches stands at the end of a long, still water channel in a white arcaded courtyard.

Is it haram to kill spiders? Many Muslims grew up with a gentle warning that one must never kill a spider, because a spider once saved the Prophet ﷺ. Others were told the opposite. The answer of the Sunnah is balanced and practical. Killing a spider or an insect is not haram in itself, and harmful pests may be removed or killed. Islam also asks us to spare creatures that do no harm, to kill only with good reason, to do it quickly, and never to torment any living thing.

What does the Quran say about spiders?

A whole sūra of the Quran, the twenty-ninth, is named al-ʿAnkabūt, “The Spider.” Its central parable compares those who rely on false protectors to a spider and its house:

مَثَلُ ٱلَّذِينَ ٱتَّخَذُواْ مِن دُونِ ٱللَّهِ أَوۡلِيَآءَ كَمَثَلِ ٱلۡعَنكَبُوتِ ٱتَّخَذَتۡ بَيۡتٗاۖ وَإِنَّ أَوۡهَنَ ٱلۡبُيُوتِ لَبَيۡتُ ٱلۡعَنكَبُوتِۚ لَوۡ كَانُواْ يَعۡلَمُونَ

“Those who take protectors other than Allah are like the spider that builds itself a house, and the frailest of houses is the spider’s house, if only they knew.”

Quran 29:41

The verse uses the spider to teach a lesson about trust in Allah. It neither commands nor forbids killing spiders. Allah says He does not shy away from parables drawn from a gnat or anything smaller (2:26), and He describes inspiring the bee to build its homes in the mountains and trees (16:68). Small creatures carry large lessons.

Did a spider protect the Prophet ﷺ in the cave?

During the migration to Medina, the Prophet ﷺ and Abu Bakr hid for three nights in the cave of Thawr while their pursuers searched the hills. A famous story says a spider spun its web across the entrance, so the searchers assumed no one had entered.

The story is reported in the Musnad of Imam Ahmad from Ibn ʿAbbās. Ibn Kathīr (d. 1373) and Ibn Ḥajar (d. 1449) considered its chain acceptable (ḥasan), while al-Albani graded it weak. It does not appear in the Quran, which mentions only the cave and the words of the Prophet ﷺ to his companion, “Do not grieve; Allah is with us” (9:40), and it is not in Sahih al-Bukhari or Sahih Muslim. A Muslim may tell the story with the caution its chain deserves, without building a ruling on it. It does not make spiders untouchable (Are all hadith authentic?).

Which creatures may a Muslim kill?

The Prophet ﷺ named animals that may be killed because of the harm they do, even by pilgrims inside the sanctuary of Mecca where all other killing is forbidden: the crow, the kite, the scorpion, the mouse, and the rabid dog (Sahih al-Bukhari 1829). Jurists extended the permission by analogy to every creature that brings real harm: venomous spiders and snakes, disease-carrying mosquitoes, cockroaches and bedbugs in a home, and pests that destroy crops and stored food.

Most house spiders are harmless, and many eat the flies and mosquitoes that trouble us. Carrying one outside in a cup is a small mercy. Clearing cobwebs from your home is ordinary cleaning, and nobody is blamed for it.

Why did the Prophet ﷺ forbid killing ants and bees?

The Quran tells how Solomon (peace be upon him) marched his armies through a valley of ants and heard one of them warn the others:

حَتَّىٰٓ إِذَآ أَتَوۡاْ عَلَىٰ وَادِ ٱلنَّمۡلِ قَالَتۡ نَمۡلَةٞ يَـٰٓأَيُّهَا ٱلنَّمۡلُ ٱدۡخُلُواْ مَسَٰكِنَكُمۡ لَا يَحۡطِمَنَّكُمۡ سُلَيۡمَٰنُ وَجُنُودُهُۥ وَهُمۡ لَا يَشۡعُرُونَ

“When they came to the valley of the ants, an ant said: Ants, go into your homes, so that Solomon and his armies do not crush you without knowing it.”

Quran 27:18

A prophet-king smiled at the words of an ant and turned to Allah in gratitude. The Prophet ﷺ taught the same regard. He forbade killing four creatures: the ant, the bee, the hoopoe, and the shrike (Sunan Abi Dawud 5267, graded sahih by al-Albani). He also told of an earlier prophet who was bitten by an ant and had the whole colony burned:

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

“An ant bit one of the prophets, and he ordered the ants’ nest to be burned. Allah revealed to him: An ant bit you, and you burned a whole community that glorifies Allah?”

Sahih al-Bukhari 3019

The scholars understood this as a ban on killing such creatures without need. When ants invade a kitchen, a Muslim may remove them, starting with cleanliness and deterrents.

How should a Muslim kill a pest when it is necessary?

  • Kill quickly. “Allah has prescribed excellence in everything,” the Prophet ﷺ said, “so when you kill, kill well” (Sahih Muslim 1955a).
  • Never burn a living creature as a punishment. When the Prophet ﷺ found that his companions had burned an ant colony, he said that no one should punish with fire except the Lord of fire (Sunan Abi Dawud 2675).
  • Do not kill for fun. Pulling apart insects, or killing animals for sport, is a cruelty the Sunnah condemns (Is hunting for sport haram?).
  • Prefer prevention. Screens, sealed food, and clean corners spare both you and the creature.

Every creature, the Quran says, has its own prayer and glorification (24:41), and the balance of insects, birds, and plants is part of the earth Allah entrusted to us (What does Islam say about the environment?). Learn more about the wider ethic in What does Islam say about animals?

A closing duʿāʾ

When Solomon heard the ant, he prayed:

رَبِّ أَوۡزِعۡنِيٓ أَنۡ أَشۡكُرَ نِعۡمَتَكَ ٱلَّتِيٓ أَنۡعَمۡتَ عَلَيَّ وَعَلَىٰ وَٰلِدَيَّ وَأَنۡ أَعۡمَلَ صَٰلِحٗا تَرۡضَىٰهُ

“My Lord, inspire me to be grateful for the favor You have given me and my parents, and to do good that pleases You.”

Quran 27:19

May Allah give us his eyes, which noticed the smallest of creatures and answered it with a smile and a prayer.

And Allah knows best. والله أعلم

Frequently asked questions

Is it haram to kill ants?

The Prophet ﷺ forbade killing ants without reason, and he rebuked the burning of an ant colony. If ants invade your food or home, scholars permit removing them, preferably by deterrents and cleanliness, and killing them only when that fails.

Is it haram to kill cockroaches and mosquitoes?

No. Creatures that spread disease or bite may be killed, by analogy with the harmful animals the Prophet ﷺ permitted pilgrims to kill even in the sanctuary. Do it quickly and without cruelty.

Did a spider really protect the Prophet in the cave?

The story is found in the Musnad of Imam Ahmad. Ibn Kathir and Ibn Hajar considered its chain acceptable, while al-Albani graded it weak. It is not in the Quran or in Sahih al-Bukhari and Muslim, so it neither makes spiders sacred nor teaches anything against them.

Is it haram to use bug spray or call an exterminator?

No. Ordinary pest control is permitted when pests threaten health, food, or property. Choose methods that cause the least suffering, and do not harm creatures that pose no threat.

Related questions

Sources

  1. Sahih al-Bukhari 3019 (the prophet who burned an ant colony)
  2. Sahih al-Bukhari 1829 (five harmful creatures)
  3. Sunan Abi Dawud 5267 (ants, bees, hoopoes, shrikes)
  4. Sunan Abi Dawud 2675 (none punishes with fire but the Lord of fire)
  5. Ibn Kathīr, al-Bidāya wa-l-Nihāya (on the cave of Thawr)

Image: Reda.bnhd, Courtyard of the Qarawiyyin Mosque, Fez, 2019. CC BY-SA 4.0, via Wikimedia Commons.. Image credits