It’s always a good idea to know what you’re drinking. And yet the identity of a crucial ingredient of an infamous alcoholic beverage has been something of a mystery until now.

Mezcal, a Mexican spirit distilled from agave plants, is famous for the pickled ‘worm’ lurking at the bottom of the bottle, which adds colour and flavour, and an element of trepidation for drinkers. All that was certain is that it’s not a worm, but some sort of insect larva.

“Mezcal’s alcohol content is relatively high, so the larvae and their DNA are really well preserved,” says Akito Kawahara of the Florida Museum of Natural History. This allowed his team to identify grubs from 21 mezcal brands.

More related content: 

Can animals get drunk?

Do monkeys get drunk? Scientists find out the truth

Image: Black-handed spider monkey © Kryssia Campos/Getty

Black-handed spider monkey © Kryssia Campos/Getty

The results, published in PeerJ, revealed them all to be caterpillars of a moth named Comadia redtenbacheri, which live inside agave leaves.

Just one question remained: what to do with the left-over mezcal? “We held some tasting parties,” says Kawahara. “I’ve become a huge fan.”

Main image: Bottle of mezcal with ‘worm’. © Esdelval/Getty