If you pick a random species of insect and look inside its cells, there’s a 40 percent chance that you’ll find bacteria called Wolbachia. And if you look at Wolbachia carefully, you’ll almost certainly find a virus called WO, lying in wait within its DNA. And if you look at WO carefully, as Seth and Sarah Bordenstein, from Vanderbilt University, have done, you’ll find parts of genes that look like they come from animals—including a toxin gene that makes the bite of the black widow spider so deadly.

How on earth did this nested set-up evolve? How did a spider gene end up in a virus that lives inside bacteria that live inside the cells of insects?

Let’s start with the bacteria. The various strains of Wolbachia are masters at infecting insects, spiders, woodlice, and other arthropods. Since their hosts are the most numerous and diverse animals in the world, Wolbachia must surely be one of the most successful microbes around. Sometimes, it manipulates the sex lives of its hosts, transforming males into females or even killing them outright. Sometimes, it provides benefits like vitamins or resistance to viruses. The latter skill is important to us, since Wolbachia’s presence can prevent mosquitoes from spreading the viruses behind dengue fever, Zika, yellow fever, and other important diseases.

This master infector gets infected, in turn, by WO. WO is a bacteriophage, or phage for short—a virus that specializes in infecting bacteria. It can actively make many copies of itself within Wolbachia, eventually bursting out with fatal results. Alternatively, it can insinuate its DNA into Wolbachia’s genome, literally becoming part of its host. As the bacterium reproduces, it copies its genome and so copies WO.

WO can also switch between these two strategies. If two strains of Wolbachia infect the same insect, WO can awaken and violently burst out of one strain, only to infiltrate the other and gently conceal itself. No surprise then that it is present in the vast majority of Wolbachia strains—a nigh-omnipresent virus lurking in the genome of one of the planet’s most widespread microbes.

Sure, WO is cool, but the Bordensteins—a husband-and-wife team—had been studying it for around 15 years, and frankly, they were getting bored. “We were losing interest because we had answered most of the big questions about it,” says Seth. But one vexing mystery remained.

Wolbachia lives inside the cells of its animal hosts. And WO can burst through not just Wolbachia but the surrounding animal cell, too. Somehow it can punch its way through two sets of barriers—one bacterial, and one animal. Once it’s out, to find a new host, it must punch its way back into another insect cell and another Wolbachia. All viruses are masters of escape and infiltration, but WO must be doubly so. How does it manage?

To find out, the Bordensteins sequenced the phage’s genome. It was largely unsurprising, containing all the expected genes for infecting bacterial hosts and building new viruses. But amid these usual suspects, the Bordensteins noticed a weird and previously unnoticed cluster of genes, taking up a full third of the WO genome.

“These genes are all very strange,” says Sarah. They’re definitely part of the phage, because they aren’t found in Wolbachia strains that don’t contain WO. But they don’t look like phage genes at all—or even bacterial ones. Instead, they had several hallmarks of animal genes, and specifically those of the spiders, insects, and other invertebrates that Wolbachia infects.

For example, the virus contained part of the gene for latrotoxin—the chemical in black widow spider venom. The toxin punches holes through the cells of victims, causing their innards to leak fatally outwards. “There hasn’t been another case of a latrotoxin being found outside of spiders,” says Seth.

It’s possible that the spiders got the latrotoxin gene from the virus, or that the two evolved their copies independently. But by comparing the various versions of latrotoxin, the Bordensteins think that it’s most likely that the virus got the gene from spiders. It certainly had the right opportunity, since Wolbachia, its host microbe, does indeed infect black widows. The phage could have picked up spider DNA directly from the creature’s own cells. Or Wolbachia could have picked up spider DNA and then transferred it to the phage. Or other as-yet-unidentified viruses and bacteria could have acted as intermediaries.

Whatever the route, this is an unprecedented find. Here’s why. All living things fall into three major groups or ‘domains’: the bacteria, the microbes we’re most familiar with; the archaea, a more obscure group of microbes; and the eukaryotes, which includes all animals and other visible, many-celled creatures. For viruses, these domains are like Hogwarts houses—each has its own, and there’s no crossover. Ebola, Zika, and influenza can lay us low, but they pose no threat to bacteria. Conversely, phages infect bacteria but don’t infiltrate the cells of animals or other eukaryotes. This fidelity is reflected in their genes. Viruses that infect eukaryotes can sometimes pick up eukaryotic DNA, but phages do not. That is, except for WO.

What’s more, it looks like WO has grabbed bits of DNA from various animal genes and merged them into new ones. “Viruses do this,” says Sarah. “It’s like a buffet. They take bits from different genes and put them together to form this super gene.”

The Bordensteins think that these chimeric genes help WO to succeed at its doubly difficult lifestyle. It can use the standard toolkit of phage genes to break out of Wolbachia, but it then finds itself in an animal cell. If it stays, it must contend with the animal’s immune system. If it wants to leave, it has to pierce an animal membrane. “Once it gets out, it needs some way of cloaking itself, or counterattacking, or evading animal defenses,” says Sarah. Perhaps it does all of that with the help of its eukaryotic acquisitions, which seem to be involved in producing toxins, interacting with the immune system, forcing cells to self-destruct, and other relevant functions.

Does this mean that the phage is actually infecting animal cells? It depends on what you count as infection. “I wouldn’t personally go that far,” says Seth, “but I think you could bend the language that way.” That’s certainly how Elizabeth McGraw, a Wolbachia specialist at Monash University, sees it. “It’s the first report of a virus infecting multiple domains of life,” she says. By picking up animal genes, WO has become “a Frankenphage that may be better at infecting animals than its ancestors that contained only phage genes.”

The phage’s abilities might also be useful to Wolbachia. This bacterium is extraordinarily good at manipulating the sex lives of its hosts, and scientists have identified several potential genes behind its skills. But the Bordensteins have found that some of these manipulation genes aren’t part of Wolbachia’s own genome—instead, they belong to WO. The couple are in the process of publishing their results; if they’re right, then here’s a bacterium that manipulates animals using animal genes found in a virus.