Mosquitoes carry microbes that cause devastating diseases, from the viruses behind Zika, dengue, and yellow fever, to the Plasmodium parasites that cause malaria. But mosquitoes, like all other animals, also harbor a more benign coterie of bacteria. And some members of this microbiome, far from causing diseases, might be the keys to preventing them.

When a mosquito bites someone with malaria, Plasmodium parasites rush up its snout and end up in its gut. There, the parasites mate and multiply, creating a new generation that can infect the next person who gets bitten. It’s also where they meet the rest of a mosquito’s native bacteria. Marcelo Jacobs-Lorena, from the Johns Hopkins Bloomberg School of Public Health, reasoned that if he could engineer those native bacteria to kill Plasmodium, he could stop mosquitoes from ever transmitting malaria.

His team first showed that this approach could work in 2012, by working with a bacterium called Pantoea, which is common to mosquitoes. The researchers loaded the bacterium with an arsenal of anti-Plasmodium genes. Some prevent the parasite from infecting a mosquito’s gut. Others kill the parasite directly by inserting small pores into its surface, forcing it to leak uncontrollably. In laboratory trials, these engineered bacteria reduced the growth of the malarial parasites by up to 98 percent, and reduced the proportion of infected mosquitoes by 84 percent.

But no matter how effective the engineered microbes are in the lab, they’re useless unless you can find a way of spreading them through wild mosquitoes. That problem stumped Jacobs-Lorena for years, until one of his team members, Sibao Wang, made a fortuitous discovery.

Wang was dissecting the ovaries of a captive malarial mosquito when he noticed that the fluid leaking out of the organs was a little cloudy. And when he dabbed the fluid onto petri dishes full of nutritious jelly, bacteria started to grow. These bacteria were all the same, and though they belonged to a group called Serratia, they were also part of a strain that no one had seen before. The team called it AS1.

AS1 was everything the team could have wished for. It can be engineered to carry the same anti-Plasmodium genes that the team added into Pantoea. But unlike that other bacterium, AS1 spreads like wildfire. It can travel throughout the body of an infected insect. When it infects the reproductive glands of male mosquitoes, it can spread to females through sex. When it infect the ovaries of a female, it can stick to her eggs. And when those eggs are laid in water, the bacteria swim around and get ingested by the mosquito larvae that eventually hatch.

So AS1 can spread effectively within generations, and into new ones. Wang demonstrated this by releasing infected mosquitoes into cages with uninfected peers, who outnumbered them by 20 to one. Within a single generation, every mosquito in the cage carried Serratia.

The team is now planning to take their mosquitoes to a field station in Zambia, and release them into a net-covered greenhouse that contains vegetation and a little hut. They want to know if AS1 will still spread effectively in these more realistic settings.

But Alison Isaacs, from the London School of Hygiene and Tropical Medicine, notes that AS1 is very similar to Serratia strains that are common in other insects. “It will be important to investigate whether the genetically modified bacteria could spread beyond mosquitoes, and identify the associated risks,” she says. One way to prevent such cross-species jumps would be to insert the antimalarial genes not into a symbiotic microbe, but directly into the genomes of the mosquitoes themselves. Jacobs-Lorena’s group have been trying to do that, too, and so has another team led by George Dimopoulos, from Johns Hopkins University.

In 2006, Dimopoulos’s team showed that when mosquitoes are invaded with Plasmodium parasites, they mount an immune response to clear the infections. But they’re usually too late; by the time they react, the parasites have already colonized their guts. So the team gave the insects an edge by tweaking a gene called REL2, which then revved up their immune systems as soon as they started sucking blood. And these modified mosquitoes were indeed more resistant to malaria.

To check that the modified mosquitoes are just as healthy as normal ones, the team shoved both kinds into cages, and left them for several generations. According to the usual laws of inheritance, the modified REL2 gene should eventually spread to 75 percent of the mosquitoes. But to his surprise, Dimopoulos found it in 90 percent of the insects, after just one generation. Somehow, it was spreading at an incredible pace. How?

The team realized that by changing the REL2 gene, they had also altered the community of microbes in the mosquito’s gut. And these microbes, in turn, changed the mosquitoes’ sexual preferences—perhaps by changing the way they smell. The modified males preferred to mate with normal females, while normal males developed an attraction for modified females. So every sexual encounter spreads the modified gene into the next generation. Dimopoulos, like Jacobs-Lorena, now wants to put these mosquitoes into more realistic enclosures to see if they behave in the same way.

These studies highlight “how little we know about the natural microbiota in vector mosquitoes,” says Elena Levashina, from the Max Planck Institute for Infection Biology. A handful of studies have shown that mosquitoes need microbes to mature, but do all species need the same bacteria? A meal of blood reshapes the bacteria in a mosquito’s gut, but are those changes important for the insects?

These might seem like arcane questions, but many unexpected benefits have come through the whimsical exploration of mosquito microbes. For example, in 1924, two scientists discovered a bacterium called Wolbachia in the cells of a Culex mosquito. Others later showed that Wolbachia is exceptionally good at spreading, and that it stops Aedes mosquitoes from transmitting the viruses behind dengue and Zika. It’s now being tested in tropical cities around the world, as a promising way for controlling these diseases. Wolbachia probably won’t work for malaria, since the bacterium doesn’t seem to counteract Plasmodium as effectively as it does dengue and Zika viruses. But as Dimopoulos and Jacobs-Lorena have shown, there are other bacteria that could take its place.

Their discoveries are similar to gene drives—phenomena where genes have more than the usual 50-50 chance of entering the next generation, and can zoom through populations. Gene drives occur naturally, but in the era of powerful gene-editing technologies like CRISPR, scientists can deliberately engineer them. A group called Target Malaria wants to use them to drive malarial mosquitoes to extinction in sub-Saharan Africa, by spreading a gene that sterilizes the females.

That’s still a long way off, with many technical hurdles to overcome, and ethical debates to wrestle with. For a start, this approach—just like Dimopoulos’s and Jacobs-Lorena’s projects—involves genetic modification, which is still a fraught and polarizing issue. A recent poll found that over a third of Americans believed—wrongly—that genetically modified mosquitoes were to blame for the Zika epidemic.

Some of the concerns are sound: It’s unclear if wiping out a species—even those as problematic as malarial mosquitoes—would have unintended ecological consequences. That’s why Jacobs-Lorena prefers the idea of using AS1. He’s not trying to kill any mosquitoes. He just wants to replace them with individuals that can’t spread malaria.

Still, “our approach is completely compatible with gene drives, or with insecticides,” Jacobs-Lorena says. “They can reinforce each other. If we can cut the populations down, and make the remaining mosquitoes unable to transmit the parasite, that would be even more effective. Or we could spread our bacteria into mosquitoes where malaria has already been eliminated, to diminish the danger of restarting an epidemic.”

“My bet is that no one method will work alone,” says Ravi Durvasula, from the University of New Mexico. “Even if we had a strategy like a gene drive, you would still want to use bed nets and drain water. All of those things go together.”