Earthworms are the secret superheroes of the garden, according to new research showing how they offer protection against slugs.
Hidden from view below ground, the humble worms seem to be able to stop slugs munching leaves.
Scientists think they boost plants' resistance to slugs by increasing their uptake of nitrogen.
In tests, the presence of earthworms in the ground reduced the number of leaves damaged by slugs by 60 per cent.
Increasing plant diversity also kept the slugs at bay, but to a lesser extent.
Austrian expert Dr Johann Zaller, from the University of Natural Resources and Life Sciences in Vienna, said: "Our results suggest that two processes might be going on.
Have to switch diets
"Firstly, earthworms improved the plant's ability to protect itself against slugs perhaps through the build-up of nitrogen-containing toxic compounds.
"Secondly, even though these slugs are generalists they prefer widely available food, and in high diverse ecosystems slugs eat less in total because they have to switch their diets more often since plants of the same species are less available."
The research is reported in the online journal BMC Ecology.
The scientists carried out the study in large incubators designed to simulate grassland environments. A range of grasses, herbaceous flowering plants, and legumes (beans) were planted.
Spanish slugs, Arion vulgaris, were then introduced and allowed to roam freely.
The slug, which grows to a length of 15cm, is one of the 100 most destructive invasive species in Europe and considered a major pest.
"Slug herbivory was significantly affected by both earthworms and plant species composition," the researchers concluded in their paper.
"Slugs damaged 60 per cent less leaves when earthworms were present, regardless of the species composition of the plant communities. Per cent leaf area consumed by slugs was 40 per cent lower in communities containing 12 plant species."
Grasses were generally avoided by the slugs, said the scientists.