Animals do the most amazing things. Read about them in this series by Janaki Lenin.

Snails evolved shells to escape from predators. Slugs, evolving from snails, did away with the awkward hard shell. Producing calcium on land, where it’s not an easy mineral to find, comes at a cost. Land snails produce thin shells. By dispensing with the shell altogether, slugs could move into soils without calcium, an area snails couldn’t exploit. In the bargain, slugs lost the ability to protect themselves from drying up. Their exposed bodies need humidity. And they also lost security from predators. But just how much those shells protect snails was unknown so far.

Since nematodes have limited mobility on their own, some hitch rides on the slow-moving creatures. But many species are parasitic and live off snails and slugs. One species, Phasmarhabditis hermaphrodita, kills these gastropods and dines on their carcasses. A pesticide company markets this species as an organic natural slug-killer to farmers and gardeners. They mix the worms, less than 2 mm long, with water and spray on soil. The unleashed nematodes hunt slugs down, infesting their bodies. Slugs teeming with internal parasites grow large mantles on their backs, go off food and eventually die. Although hermaphrodita is ruthless in its pursuit of these gastropods, it is not as successful in finishing off snails.

While on vacation three years ago, Robbie Rae, who teaches at the Liverpool John Moores University, U.K, walked his dog on the sand dunes in the north of Scotland. He saw heaps of pretty white-lipped snail (Cepaea hortensis) shells and took a handful to work. When he looked at the shells under a microscope, he found small, worm-like structures on their inside walls. He thought they were minor imperfections like cracks or scratches. But the more he looked, the more he became convinced they were nematodes.

“I absolutely could not believe what I was seeing,” Rae told The Wire. “The snail shell, I thought, was a static structure, hard as rock. How and why would nematodes be in it? My brain could not understand this at all. It just seemed so weird so I didn’t do anything with it and tried not to think about it.”

Later that summer, Alex Williams, one of Rae’s students, carried out an experiment infecting brown-lipped snails (Cepaea nemoralis) and giant African snails (Achatina fulica) with nematodes. Rae entered the lab when Williams started shouting, “They’re in the shells! They’re in the shells!” “I didn’t know what on Earth he was on about,” recalls Rae. “When I saw them there again, it was very clear – the shell has a remarkable ability to kill nematodes.”

In 2015, Rae and Williams published their discovery that giant African snails, an invasive pest in many tropical countries, were impervious to the slug-killers. The infected snails continued to gain weight and munch their way through the greenery. On dissecting the gastropods, the researchers found hundreds of worms trapped and killed within the shells.

In the following year, they published similar results from studying brown-lipped snails. “The nematodes appear as if perfectly preserved in amber and are completely covered by unknown cells,” wrote the researchers.

In the latest study, Rae investigated whether these were exceptional snails or whether nematode-killing was routine land snail behaviour.

He allowed the nematode hermaphrodita to infect captive brown-lipped snails and observed the results by dissecting the snails. Cells in the shell somehow identify the intruder, perhaps by sensing various proteins or collagens on the nematodes’ skin. “Over time these cells multiplied on the inside of the shell, attached to the nematode cuticle and swarmed over the entire body and engulfed it. When the nematodes were completely covered they were then fused to the inner layer of the shell,” he writes. Oysters protect themselves from external irritants using an identical strategy, one exploited by humans for culturing pearls.

Rae repeated the experiment with other nematodes Steinernema feltiae and Heterorhabditis bacteriophora that didn’t prey on gastropods. But brown-lipped snails sealed them in their shells, too. Snail shells are a successful defence against any nematode, not just parasitic ones.

Rae tested wild brown-lipped snails that he picked from north-west England and white-lipped snails (Cepaea hortensis) from northern Scotland. Their shells too were gravesites of nematodes. Using PCR and DNA sequencing, he identified four species of nematodes in the shells of brown-lipped snails and a fifth from common garden snails (Cepaea aspersum).

Rae says this was the hardest part of doing the study. “I spent a lot of time trying to scratch away at the surface of the shells to get at the few nematodes which were encased in the shells,” he says. “A lot of the time when I managed to bore into them they would just crumble away. So there was a lot of failed DNA extractions and a lot of wasted reagents. Sometimes, the PCR would work and sometimes not. It was very frustrating, but then when I looked at another snail species C. aspersum [common garden snails] I could extract and amplify nematode DNA easily and consistently. In fact, it worked every time. It was a great feeling identifying Caenorhabditis elegans from those shells and seeing the DNA sequences for the first time.”

Rae examined museum collections of brown-lipped snail shells in Liverpool and Manchester. In the 1950s, evolutionary biologist Arthur Cain studied the different forms and bands of brown-lipped snails. Rae concentrated on this assemblage as the specimens had good records of where and when they were collected. Not only did he find nematodes stuck to the shells of snails collected in the 1950s, but in other shells collected back in 1864. What’s more, he also found them in shells of brown-lipped, white-lipped, and garden snails estimated to be more than 500 years old.

Expanding his search to other snails, Rae looked at 1,321 shells of 43 genera from 20 families collected around the world from the late 19th century to the mid-20th century. The shells of 34 species from 15 families had evidence of nematodes. So an ancestor must have evolved this defence mechanism before the different families split about 90 to 130 million years ago.

Although slugs don’t have a visible shell, many species still have the remains of one on their backs, inside their bodies, or even as granulated particles. Slugs use all these types of shells to kill nematodes.

Rae suggests that the gastropods deploy their anti-predator shells to perform additional duty as anti-parasitic defence. But this strategy seems specifically focused on killing nematodes only. Of the 5,000 shells he examined, none had evidence of parasitic flies or flukes called trematodes, some of which carry schistosomiasis. Flukes are not lethal to gastropods as they only hitch a ride on them for a part of their life cycle. Perhaps this was the reason, land snails didn’t seal them in alive to the walls of their shells.

Some genera of an extinct group of marine molluscs, the ammonoids, that lived approximately 400 million years ago trapped parasitic trematodes in much the same way as land snails kill nematodes. Palaeontologists call the structures with entombed parasites ‘Housian pits’ – those lumpy things that everyone else calls ‘blister pearls’. Modern-day marine molluscs like bivalves continue to isolate invading parasitic flukes with nacre even though trematodes use these marine molluscs as an intermediate stage as they do land snails.

Why do bivalves go after flukes while land snails don’t? “A possible reason why this defence seems to only work for nematodes is because of how they enter the host – which is different to the larvae of parasitic flukes and other parasites of snails,” Tommy Leung, lecturer at the University of New England, Armidale, Australia, told The Wire.

“Though the mechanisms involved are probably quite different, the function is comparable,” says Leung. “This raises the question as to whether this is a common characteristic to molluscs as a whole. This may explain why many snails and slugs retain an internal shell, even though it would be useless for anti-predator defence. It would be worth seeing if other groups of molluscs such as cephalopods (squids, cuttlefish), and chiton are also capable of entrapping parasites with their shells (both internal and external). Together, this would actually give molluscs a rather unique anti-parasitic defence which is not found (as far as we know at the moment anyway) in other phyla of animals.”

Rae plans to find answers to questions such as: How do these shells’ cells recognise these nematodes and how did some nematodes evolve to avoid these cells?

He also plans to study nematodes in ancient shells. “Nematodes are not well preserved during fossilisation but perhaps their DNA is in these snail shells,” he says. “After all the encased nematodes would be sheltered from extreme temperatures and water (which break down DNA). I think therefore there could be a good chance that we could start looking at the evolution of parasitic nematodes over time by looking at these shells – this I find very exciting.”

If Rae’s experience with this study is anything to go by, he’s in for a hard, frustrating slog.

The study was published in the journal Scientific Reports on July 6, 2017.

Janaki Lenin is the author of My Husband and Other Animals. She lives in a forest with snake-man Rom Whitaker and tweets at @janakilenin.