Scientific inspiration can strike anywhere—even at a restaurant bar in Oaxaca, Mexico. That’s where a team of insect researchers decided to use DNA sequencing to identify what larva lurks in bottles of the nation’s iconic alcohol, mescal.

“We were taking a break, we were at a restaurant, and then we just saw these bottles,” says Akito Kawahara, lead author of the new research and a curator of butterflies and moths at the Florida Museum of Natural History. “One thing led to the next, and we started to think about what the larva is.”

And in an analysis of nearly two dozen bottles of alcohol, the scientists determined that all of the mescal “worms” they tested belonged to a single species of moth, according to their study, which was published on March 8 in PeerJ. Finding only one species was a bit of a surprise, Kawahara says, because he and his colleagues had identified three primary suspects, all of which are larvae of parasites of the agave plants that are processed to create mescal: a butterfly called the tequila giant skipper (Aegiale hesperiaris), the agave snout weevil, (Scyphophorus acupunctatus) and Comadia redtenbacheri, a moth whose juvenile form is known as the red agave worm. It was this last species that proved to be the mystery larva.

Mescal is closely related to tequila, which is made exclusively from a specific variety of agave, whereas mescal can be made from many species. Tequila never includes a worm, but mescal can. It’s a marketing tactic that nods to Mexico’s strong culture of eating insects (the country is home to more than 400 edible species). Anne Gschaedler, a researcher at the Center for Research and Assistance in Technology and Design of the State of Jalisco (CIATEJ) in Mexico, who was not involved in the new study, says that today mescal with a worm is more sought after by non-Mexicans than locals, however.

Some scientists who were not involved in the paper have found its discovery predictable. “The results are hardly surprising,” said Ricardo Castro-Torres, an entomologist at Postgraduate College in Mexico, in an e-mail to Scientific American. “In my opinion, there really is a consensus about what species is included in mescal bottles.” (Kawahara notes that the new study is the first genetic analysis of mescal worms and that past research he reviewed was unclear on the species’ identity.)

A jar of Comadia redtenbacheri larvae, which are sometimes added to bottles of mezcal.
A jar of Comadia redtenbacheri larvae, which are sometimes added to bottles of mezcal. Credit: fitopardo/Getty Images

Researchers have long known that C. redtenbacheri lays its eggs on agave plants. The larvae tunnel into the plant’s fleshy base to develop, growing (and distinctively reddening) before turning into a cream-colored moth and leaving the plant. “They’re pretty unusual moths,” Kawahara says, referring to the color change.

For the new study, Kawahara and his colleagues gathered 21 bottles of mescal from 18 different manufacturers, pouring each bottle through a sieve to snag the “worm.” (A true worm remains wriggly throughout its life, but all three mescal worm contenders are larvae waiting to metamorphose into their adult form.)

Then the researchers studied each specimen directly and took a piece of its thorax for DNA sequencing. Fortunately for the bar sleuths, mescal is an ideal environment to sample from because the alcohol helps preserve genetic material. In the end, the genetic analysis identified 18 of the samples as C. redtenbacheri. The researchers couldn’t get DNA samples from three of the worms, which was likely because those worms had been baked before being placed in the mescal, they wrote. Those specimens were a morphological match for the red agave worm.

The study may not be good news for wild red agave worms. Kawahara says these larvae are getting harder to find. C. redtenbacheri moths rely exclusively on agave plants for most of their life cycle, even as the local environment is changing and demand for mescal and agave alike are rising. More mescal production might mean more agave plants for worms to live in, but crop damage (especially from the agave snout weevil, which was a contender for the mescal worm’s identity) could lead growers to start using pesticides in earnest.

“If the demand continues the way it has been, I do worry about that,” Kawahara says. “Even though the moth is not necessarily endangered or threatened or anything like that at this stage, the possibility that that kind of thing can happen is definitely present.”