The ruling on killing insects during ihram depends on whether the creature is classified as harmful (mu'dhi) or harmless. Scholars unanimously agree that the muhrim (person in ihram) is permitted to kill harmful creatures, based on the hadith of Aisha in which Hz. Peygamber (sallallahu aleyhi ve sellem) ordered the killing of five harmful creatures whether in the sacred precinct or outside it: the scorpion, the kite (bird of prey), the crow, the mouse, and the rabid dog. Scholars extended this ruling by analogy to include mosquitoes, wasps, snakes, and any creature that poses a threat to the haci.
Sheikh Ibn Uthaymeen ruled that killing mosquitoes and other biting insects during ihram is permissible because they are harmful creatures, and the haci is not required to endure their harm. He noted that the general principle is that the muhrim is prohibited from hunting land game (sayd), but insects are not classified as game animals. Sheikh Ibn Baz similarly confirmed that swatting mosquitoes and killing harmful insects carries no penalty.
Regarding harmless insects such as ants and bees, scholars recommend avoiding killing them, both during ihram and outside it, as Hz. Peygamber (sallallahu aleyhi ve sellem) prohibited the killing of ants, bees, hoopoes, and shrikes. However, even if a harmless insect is killed accidentally during ihram, no fidyah is due. The key distinction scholars make is between land game (sayd al-barr) — which is explicitly prohibited for the muhrim — and insects, which are not classified as game.