A fungus that infects the brains of ants, effectively turning them into zombies, is actually vulnerable to a parasite itself, according to new research.

The zombie-ant fungus, or Ophiocordyceps, acts like a puppeteer. Once in the brain, it will steer an ant to its death -- usually manipulating it to latch onto a leaf, where the fungus spores will erupt out of its lifeless head and spread to new hosts.

Scientists already knew ants try to defend their colonies from the brain-eating spores by efficiently grooming each other. But a new study published Wednesday in the journal PLoS ONE found they also have some help from a counter-fungus.

"In a case where biology is stranger than fiction, the parasite of the zombie-ant fungus is itself a fungus -- a hyperparasitic fungus that specializes in attacking the parasite that turns the ants into zombies," said lead researcher David Hughes of Penn State.

Hughes explained that the hyperparasitic fungus "castrates" the zombie-ant fungus so it cannot spread its spores, meaning fewer of the ants will be turned into zombies.

The zombie-ant fungus directs its hosts to die in one place of the colony, creating a spooky mass grave of infected corpses. But the researchers found only 6.5 percent of those ants' spore-producing organs threatened to spread the fungus.

"Even though there are a lot of dead and infected zombie ants in the neighborhood, only a few of the spores of the zombie-ant fungus will become mature and able to infect healthy ants," Hughes said. "Our research indicates that the danger to the ant colony is much smaller than the high density of zombie-ant cadavers in the graveyard might suggest."

The study was based on data from Camponotus rufipes in the rain forests of Brazil and carpenter ants in Thailand.