Here are some things parasites will do to survive.

The hairworm makes infected crickets commit suicide in water so it can find a mate. Parasitic barnacles invade the bodies of crabs, sterilize them, and then trick them into caring for baby parasitic barnacles. Toxo makes rats so fearless that they run straight to cats, whose feces spread the parasite.

In other words, parasites sometimes possess not just the bodies of their hosts. They seem to possess their minds.

Malaria, which sickens more than 200 million people a year, seems to have some mind-altering powers over mosquitoes, too. The parasites that causes malaria, which belong to the genus Plasmodium, spread to humans through mosquito bites. A handful of studies have found that female mosquitoes infected with a certain stage of the parasite are more eager for blood. And conversely, humans infected with malaria seem to emanate signals that attract more mosquitoes.

A new study in Science actually illuminates how the parasite in human blood draws mosquitoes, manipulating the bugs into flying malaria-dispersal machines.

The discovery came by accident. Ingrid Faye, a molecular biologist at Stockholm University, was curious about a particular molecule made by malaria parasites called HMBPP. She wanted to drill into the details of how HMBPP affects mosquito immune systems, but her team ended up noticing some behavior too odd to ignore: The mosquitos—specifically, the species Anopheles gambiae they were studying—would go crazy for human blood with HMBPP. “The difference it made was just astounding,” says Faye. When given a choice between normal human blood and that either laced with the HMBPP or infected with malaria parasites, almost all the mosquitoes went for the latter two.

An interesting result, for sure, but a practical one? For example, how could a mosquito in the real world sense a molecule in blood trapped underneath skin? So Faye’s team went further. They collected the volatile molecules emitted into the air above red blood cells that had been either mixed with HMBPP or infected with the malaria parasite. Volatile molecules could have the ability to pass through skin. In fact, one of these molecules is carbon dioxide, a known mosquito attractant that is definitely emitted through skin. And sure enough, the air above the blood had a similar effect on the mosquitoes as actual blood.

Faye’s team had done what scientists studying parasites are rarely able to do—identify an actual molecule seemingly responsible for manipulating host behavior. “It’s definitely one of the first times I’ve seen a specific parasite factor implicated,” says Lauren Cator, a mosquito behavioral ecologist at Imperial College London who wasn’t part of Faye’s study. Scientists have noticed behavioral changes with a few other diseases spread through mosquitoes—filarial worms and dengue, for example—but the molecular mechanisms are usually unclear. In a way, Faye’s team got lucky. They just happened to pick the right molecule to study.

James Logan, a medical entomologist at the London School of Hygiene and Tropical Medicine, calls the study an “exciting piece of work,” but wonders if HMBPP tells the whole story. “One drawback is that it hasn’t been done on a natural system”—by which he means on living humans. Logan is collaborating with Wageningen University on research in Sub-Saharan Africa to collect body odors from malaria patients—asking them to either put their feet in plastic bags or wear nylon socks. (“Nylon socks are a good matrix for collecting human body odor,” says Logan, confirming the beliefs of everyone who has met a stinky sock. ) Since HMBPP could responsible of some—but not all— of the mosquito-attracting odors, Logan is testing the scents of actual humans to suss out what else is going on.

The current study also only solves one side of the puzzle. HMBPP seems to explain why mosquitoes are drawn to malaria-infected humans, but it doesn’t explain why malaria-infected mosquitoes are also more attracted to humans. A lot is still unknown here. A better understanding of how malaria parasites lurking in either humans or mosquitoes manipulates the insects to bite could mean a better handle of how the disease spreads.

It could also present a way for scientists to turn the parasite’s fiendishly clever strategy into a weakness. If the parasites are altering mosquito behavior, for example, you could specifically target the infected-mosquitoes with the odd behavior. This works, says Cator, because “if you look at the whole population of mosquitoes, only a small proportion of them are going to pick up parasites and an even smaller proportion are going to live long enough to transmit the disease.” Instead of using insecticides that wipe out all mosquitoes, you could find ways to trap and kill just the ones carrying malaria.

How parasites manipulate behavior has been largely a niche interest of ecologists and entomologists. It makes for interesting stories about obscure creatures. But as scientists work out how parasites that cause human diseases manipulate behaviors, the insights are bubbling up from ecology into public health.