Stresses in your early life — like traumatic external events — can alter the delicate balance of your gut microbiota, something that’s linked to immune system, digestive, and mental health. And these changes in your gut microbiota can ultimately lead to a higher risk of anxiety and depression later in life, according to a new study published in Nature Communications.

“Early life stress is a determinant of vulnerability to a variety of disorders that include dysfunction of the brain and gut,” the authors, from McMaster University in Canada, wrote in the abstract. “Here we exploit a model of early-life stress, maternal separation in mice, to investigate the role of the intestinal microbiota in the development of impaired gut function and altered behavior later in life.”

Past research has shown that gut bacteria can impact a person’s mental health and behavior — even influence social anxiety — but the researchers of the new study wanted to explore it further. They examined two groups of mice — one with normal, healthy gut bacteria and another that had no gut bacteria. Mice in each group were exposed to early-life stress, such as being separated from their mothers for three hours every day between the ages of three to 21 days.

Interestingly, the mice with normal gut bacteria developed high levels of the stress hormone corticosterone — then developed anxiety, depression, and impaired gut function. But the mice who had no gut bacteria, while they showed high levels of corticosterone, didn’t end up exhibiting anxiety or depression later on. When the researchers transferred gut bacteria from stressed mice to those that were stressed but had no gut bacteria, it triggered both anxiety and depression.

“This suggests that in this model, both host and microbial factors are required for the development of anxiety and depression-like behavior,” Premysl Bercik said in the press release. “Neonatal stress leads to increased stress reactivity and gut dysfunction that changes the gut microbiota which, in turn, alters brain function.”

The relationship between gut bacteria and human health is complex and fascinating, and researchers are just finally beginning to understand it. The researchers conclude that even “minor changes” in the gut microbiota “can have profound effects on host behavior in adulthood.”

Of course, it’s important to note that the study was only completed in mice; in order to be fully transferred to humans, the researchers will need to replicate the findings in a clinical trial. They hope that their findings will impact future treatments down the road for people with mental illnesses like anxiety and depression. In the meantime, if you want to boost your gut bacteria, check out these probiotic-filled foods.

Source: Palma G, Blennerhasset P, Deng J, Park A, Green W, Denou E. Microbiota and host determinants of behavioral phenotype in maternally separated mice. Nature Communications. 2015.