Petrified human feces from the 14th century have revealed the earliest evidence of an arms race in the human gut. Our intestinal bacteria, it seems, were employing antibiotics long before people developed drugs like penicillin.

The bacteria that live in your intestines are territorial little suckers. When new microbes arrive, the natives fight them off with antibiotics. The invaders respond by developing immunity to these compounds. So the native bacteria in your gut—known as the microbiome—develop ever stronger antibiotics. This war has likely been waging in the human intestine for eons, but scientists have had little evidence of its history.

That’s now changed, thanks to a surprise find in Namur, Belgium. An urban development project there unearthed some historic bowel movements in 1996. Excavation under a town square revealed latrines from the Middle Ages buried 4 meters deep. Each held sealed barrels of human waste that had not been aired out in nearly 700 years.

Paleomicrobiologists carefully extracted the fossilized feces—known as coprolites (they look a bit like poop-shaped rocks)—from the barrels to prevent modern bacteria and viruses from contaminating the medieval microbes. A preserved fecal deposit eventually plopped into the virology lab of Christelle Desnues at the Research Unit on Infectious and Emerging Tropical Diseases (URMITE) in Marseille, France.

Her team bored into the coprolite, extracting a piece of its core approximately the weight of a nickel. Electron microscopy exposed viruslike structures peppered throughout the samples. When the team sequenced the genomes of all the viruses in the ancient poop, they discovered that most of them were bacteria-loving viruses called bacteriophages, or “phages” for short. Phages are the cargo ships of the bacterial world, picking up genes from one bacterium and transferring them to another. Occasionally, this process instills their bacterial hosts with an evolutionary advantage. Indeed, researchers have observed modern-day phages shipping antibiotic resistance genes between bacteria that cause infections, thus increasing their virulence.

Desnues and her team discovered that the phage genomes from the coprolite were packed with antibiotic resistance genes, as they report online this month in Applied and Environmental Microbiology. This supports that bacteriophages are an ancient reservoir of resistance genes in the gut, dating back as far as the Middle Ages, Desnues says.

A broader diversity of antibiotic resistance genes were observed in the coprolite. “It was surprising that the ancient stool had more [antibiotic resistance] genes than modern stool samples,” says Jeremy Barr, a microbiologist at San Diego State University in California who was not involved with the study. If this coprolite specimen is representative of the time period, then the reduction in these genes over time may reflect that modern sanitation in food or water supplies have weakened the defenses of gut bacteria, he says.

Interestingly, Desnues’s team’s research reveals that the phages also carried metabolic genes that equip host bacteria with the ability to process fats and amino acids, which may be the traits that made them so useful to our intestines in the first place. Members of the human microbiome help us digest food, temper inflammation, and may fight obesity—so their resistance to antibiotics actually benefits us.

“It's as if we need these phages as part of our microbiome,” says Vincent Racaniello, a microbiologist at Columbia University who was not involved in the research. He says that though the species of gut phages have changed over time, the key genes that they swap have remained the same. “We evolved as humans to house [gut phages] for the functions they provide—that’s the coolest part.”