It's like "Invasion of the Body Snatchers," but with ants.

A new study is shedding light on the mysterious markings of zombie ants, tropical carpenter ants that take their orders from a fungus. The fungal vampire carves its way into an ant's body and compels it to crawl over and devour vegetation until it meets its fate clasped to the underside of a leaf or twig. As the grand finale, toxic spores bloom from the dead ant’s head and drift to the ground below, onto more unsuspecting zombies-to-be.

It hasn’t been clear exactly how the fungus exerts this seeming mind control over the ant, but scientists figured that it made its way directly into the ant’s brain. Now, using 3-D computer modeling and artificial intelligence to process samples, the researchers were surprised to discover that the fungus, called Ophiocordyceps unilateralis sensu lato, invades an ant's whole body and leaves the brain untouched.

"You'd think that to control an animal, you might need to control the brain," says first author Maridel Fredericksen, currently a doctoral candidate at the University of Basel Zoological Institute in Switzerland. "It's not present in the brain. It seems like it's controlling it from the outside somehow."

Study co-author David Hughes of Penn State University says the fungus puppeteers an ant, tweaking its muscles but leaving the brain intact. The parasite may preserve the brain, he says, because it needs it to drive the host to an area where it can infect other ants at the end of its life. The parasite can't get directly inside ant colonies because the microclimate doesn’t foster its growth.

"It's very specific in where the ants go to die,” Hughes says.

Charissa de Bekker, a professor at the University of Central Florida, says the complex phenomenon might hint at what's going on inside the ant, since past research hasn’t been able to re-create what’s going on inside the insects. The fungus is probably secreting a compound, she says, that causes the ant to take up the strange, possessed behavior.

"If it were merely destroying brain tissue, I don't think this would be possible," de Bekker says.

Hughes says this research could be helpful in the future to investigate other fungal diseases and defenses. Genetically, humans and fungi share more in common than plants and fungi, so things that kill people are more likely to kill fungi than plants.

In terms of artificial intelligence research, “this is quite a new technique that people might be excited about,” de Bekker says.