Some 50 million years before humans figured it out, agriculture arrived in the world in a seemingly unlikely place: an ant hill.

Eschewing wheat or rice for feathery white fungus, the ants cultivated their fungal crop, providing it with care in exchange for nourishment. But like their human counterparts who would come after them, the ants faced the perennial problem of crop disease, in this case a parasitic fungus, which threatened to wipe out their harvests.

So the ant farmers evolved another partnership. They offered safe harbor and nutrition to a certain group of bacteria — the Actinobacteria — that in turn produced antibiotics capable of keeping the parasite at bay. To help the bacteria stick around, the ants’ exoskeletons evolved specialized pockets that protected and fed their partners.

These structures seemed so intricate that scientists believed they only had the chance to evolve once as the original fungal farmers eventually diverged into the 250-some ant farming species we find today. But writing today (Oct. 1) in the Proceedings of the National Academy of Sciences, University of Wisconsin–Madison researchers reveal that these bacteria-harboring structures evolved independently three times.

The results make it clear that the constant threat of crop parasites repeatedly pushed evolution in strikingly similar directions, creating structures that helped the ants reinforce their partnership with bacteria. And their successful use of protective antibiotics for eons suggests the ants may have lessons for human medicine, which has quickly come up against resistance by pathogens to our most important antibiotics.

The work was led by UW–Madison Professor of Bacteriology Cameron Currie and Hongjie Li, a postdoctoral researcher in the Currie lab. They partnered with colleagues at Arizona State University, the University of Sao Paulo, Harvard Medical School and the Smithsonian.

“This work provides fascinating insights into an animal using bacteria to provide antibiotics over a long period of time,” says Currie, who has researched the dynamics of farming ants for 20 years.

The researchers performed an exhaustive survey of 69 ant species, sourcing diverse ant samples from the collections at Arizona State University and the Smithsonian. The research team reconstructed the ants’ evolutionary tree using pieces of their genomic sequences. The resulting tree suggested that the partnership between ants and bacteria evolved soon after the ants began farming.

Further evidence for the ancient origin of the ant-bacteria relationship came from a handful of fungus-farming ants fortuitously frozen in amber from what is now the Dominican Republic. Through the hardened tree sap, the researchers could spot the telltale signs of bacteria clinging to the ants’ bodies. With the amber dated to between 15 and 20 million years old, Currie’s team could validate their genomic data and show that the ant-bacteria symbiosis was at least as old as the amber samples.

Earlier work had hinted at the early evolution of the ant-bacteria partnership, says Li, but “this paper provides much more evidence that this is an ancient system.”

Using ultra-high-magnification electron microscopy, the researchers examined the ants for the specialized structures housing bacteria, known as crypts. The microscopic images showed that most living species of farming ants had crypts and related structures that could support Actinobacteria. But a number of ant species were missing these structures.

When they mapped the crypt data over the reconstructed evolutionary tree, Currie’s team saw that crypts had evolved not once, but three separate times during the evolution of farming ants.

But the crypts were not ubiquitous. Some species have lost any obvious structures for supporting bacteria. The researchers showed that ants that have done away with crypts have also lost any trace of symbiotic Actinobacteria.

Currie and Li venture that ants that now farm in more arid areas no longer contend with the constant threat of the parasitic fungal disease. Since harboring and feeding the bacteria can use up to a quarter of an ant’s energy, it became more advantageous for the ants to part ways with their erstwhile partners.

Apparently not content to mimic the ant’s farming lifestyle, humans would later turn to the same group of bacteria, the Actinobacteria, for most of our clinical antibiotics. That the ants have, for millions of years, used similar antibiotics to protect their fungal gardens from pests suggests that we might learn from their success.

“I strongly believe there are mechanisms here that reduce the emergence of antibiotic resistance,” says Currie.

Discovering what those mechanisms are might just help us extend the useful life of our own antibiotics.

This study was funded by the National Institutes of Health (grants U19 TW009872-05, U19 AI109673, and DMR-1720415), the National Science Foundation (grants DEB 1456964 and 1654829), and the Sao Paulo Research Foundation-FAPESP (grant 2013/50954-0).