A new study in the journal Science examining the genetics of the bacteria living in the guts of African great apes and people from Connecticut supports the idea that our microbiome has been evolving with us, despite bacteria-affecting changes in environment, diet, geography, and for humans, medicine usage.

Using fecal samples, an international team of scientists led by researchers from the University of Texas at Austin created evolutionary trees for three different groups of bacteria that make up one-fifth of the human gut microbiome, tracing bacterial species back millions of years. They found that our gut microbiome can be traced all the way back to before the human species existed, to the common ancestor that both humans and great apes evolved from millions of years ago. Gut microbes have evolved in parallel with the different species, they say, with genetic splits in bacteria occurring at the same time as gorillas diverged from other hominids about 15.6 million years ago (which is much earlier than some previous estimates) and humans split from chimps and bonobos roughly 5.3 million years ago.

This means that though our environment does affect our microbiome (eating less fiber, for instance, has been shown to alter the bacterial makeup, as has using deodorant), genetics play a major role in the types of species we play host to.

There’s potential that some of our bacterial lineage may be shared with species even farther back in the evolutionary tree, the researchers say. “Maybe we can trace our gut microbes back to our common ancestors with all mammals, all reptiles, all amphibians, maybe even all vertebrates,” study author Andrew Moeller postulates. This research doesn’t dive quite so deep, but future studies might explore those issues.

Know of something you think we should cover? Email us at tips@mentalfloss.com.