Our gut is full of tiny creatures that help us digest our food, protect us from harmful intruders, and act as the telephone line between our digestive system and brain. From bacteria and fungi to viruses, these microbial communities help keep our insides shipshape.

But when we take medications, we disrupt this tightly run ship and not just temporarily, a large new study finds. The impact of these drugs can still be seen years later.

What's more, it's not just antibiotics that cause this intestinal havoc, but other common medications do too.

Related: Unusual Activity in Our Guts Could Have Helped Our Brains Grow Larger

"The effect of drug usage has been underestimated," a team led by genomicist Oliver Aasmets from the University of Tartu in Estonia writes in its paper.

"The effects of antibiotics, psycholeptics, antidepressants, proton pump inhibitors, and beta-blockers are detectable several years after use."

Faecal bacteria. Scanning electron micrograph (SEM) of bacteria cultured from a sample of human faeces. At least 50 per cent of human faeces is made up of bacteria shed from the gut. Many of these bacteria are a normal part of the flora found in the intestines and are beneficial to digestion. However, some are pathogenic, such as Salmonella enterica and certain strains of Escherichia coli, which can cause foodborne illnesses. Magnification: x6000 when printed 10 centimetres wide
Culture of microbes shed from human gut under scanning electron micrograph. (Steve Gschmeissner/Science Photo Libary/Getty Images)

Aasmets and his team investigated the records of 2,509 people who participated in the Estonian Biobank project.

Amongst the data, including a subset of 328 follow-ups, the researchers could see how stopping and starting certain medications shifted patients' microbiomes. This suggests a possible causal effect, the researchers explain.

Out of the 186 drugs the team investigated, 167 (almost 90 percent) were associated with changes in fecal microbiome samples.

"Human-targeted drugs indeed seem to lower the diversity by eliminating specific taxa," explain Aasmets and team.

Benzodiazepines, commonly used for anxiety, had an impact equivalent to broad-spectrum antibiotics, well known to be destructive to our inner ecosystems.

What's more, not all benzodiazepines had equivalent effects. For instance, alprazolam (brand name Xanax) had a broader impact on gut microbe diversity than diazepam (brand name Valium). This suggests we may need to optimize which drugs are not only best for a particular condition, but also do the least damage to our microbiomes.

These impacts can also compound.

"The more a medication is used, the stronger the impact on the microbiome," the researchers write.

"We identified carryover and additive effects."

Win a $10,000 Space Coast Adventure Holiday

Previous studies in mice suggested long-term antibiotic use can disrupt the gut's mucosal lining, which may contribute to weight gain. The team urges more research to determine the consequences of long-term exposure across diverse drug classes.

"Most microbiome studies only consider current medications, but our results show that past drug use can be just as important as it is a surprisingly strong factor in explaining individual microbiome differences," says Aasmets.

"We hope this encourages researchers and clinicians to factor in medication history when interpreting microbiome data."

This research was published in mSystems.