The tobacco hornworm or Manduca sexta chases away its predators by its nasty nicotine breath, a new study has revealed. The bug uses a nifty trick to convert some of its food into a cloud of poisonous compound that repels its enemies.

“It’s really a story about how an insect that eats a plant co-opts the plant for its own defense,” study researcher Ian Baldwin, a professor at the Institute told LiveScience.

Researchers knew that caterpillars that feed extensively on nicotine containing plants are usually avoided by ants and wasps. However, no one knew why this happened.

Also, an earlier research had shown that tobacco hornworms grown on plants that don’t produce much nicotine have lower activity of CYP6B46 gene. This study had pointed to the role of genes in helping the bug neutralize the ill-effects of nicotine.

For the present study, researchers altered some genes in the plants to disrupt caterpillars’ ability to detect the compound in its food, Smithsonian reported. The changes in the plant gene resulted in silencing a corresponding gene in the caterpillar. These modified plants were then grown in a private ranch in Utah. The experts then observed how this change in diet affected the bugs’ survival technique.

The team found that hornworms that fed on these genetically modified tobacco plants were more likely to be preyed on by wolf spiders.

The conclusion was an obvious one- the absence of the gene meant that the bugs weren’t able to neutralize the effects of nicotine. However, the team didn’t find any traces of the compound in the hornworms’ feces. Instead, researchers found that CYP6B46 was helping the bug use some of the nicotine and send it to haemolymph. From there, the nicotine was sent to small pores on the caterpillar’s flanks known as spiracles. These pores release small amount of nicotine, creating a nicotine cloud around the bug, the National Geographic reported.