For the past decade, scientists have been fascinated by how the bacteria in our guts influence our health and determine whether we get sick. Yet a big question has remained unanswered: How did we get those original microbes at the beginning of our lives?

A study titled “Baby Biome” released today in Nature offers a clue: It turns out the way we were born plays an important role in determining which of the 5,000 different species of microorganisms colonize our guts. A group of scientists from the United Kingdom’s Wellcome Sanger Institute, University College London and the University of Birmingham, analyzed the gut microbiota DNA from 596 newborns in British hospitals and concluded that babies delivered via caesarean section had different gut microbes than those who were born vaginally.

“We really sat down to try and design a study that would allow us to understand how babies are colonized with microbes in the first moments after birth,” Nigel Field, a molecular biologist at UCL and co-author of the new research, said at a press conference. “We think that can be a really critical moment in life because babies are sterile when they’re in the womb, and the moment they are born is a moment when the immune system has a huge of number of bacteria that it’s presented with … that sets the immune system for future life.”

The new study found that babies born via caesarean section had more harmful pathogens picked up in the hospital that could expose them to future infections—pathogens that were more likely to have antimicrobial resistance—compared to vaginally delivered babies.

“The babies born vaginally seem to have acquired their bacteria from their mother, and the acquired bacteria are found in their mother’s gut,” he says. “[In] the babies born by caesarean that transmission pattern is disrupted. The more common bacteria that are found in babies born by caesarean are bacteria associated with hospital settings.”

The research could help shed light on previous studies that found babies born via caesarean section had a slightly higher risk of immune-related diseases that can affect them later in life, such as asthma and other allergic conditions.

However, the researchers stress that the microbiomes of babies born via caesarean section eventually resembled those born vaginally. “We also found that these differences largely even out over time,” Field says. “By the time babies are weaned around six to nine months, these differences have largely disappeared. That’s really important because we don’t know the long-term consequences of these findings.”

The finding that babies’ microbiomes ultimately look similar regardless of how they were born is a crucial take-home message for mothers, who doctors say shouldn’t worry if they have undergone a caesarean section, which is often a life-saving intervention. In the United States, some 32 percent of all deliveries in 2017 were caesarean, according to data from the Centers for Disease Control and Prevention.

The study authors also genetically sequenced the gut microbiomes of 175 mothers in addition to their babies and learned that the vaginally born infants’ guts were not determined by bacteria found in the vaginal canal they encountered during birth, as some researchers have previously thought. The finding calls into question the controversial practice of vaginal swabbing or “seeding,” in which doctors smear some of the mother’s vaginal fluid on the face or mouth of babies born by caesarean in an attempt to mimic the vaginal birth experience.

“There’s no evidence that it works,” says David Eschenbach, professor of obstetrics and gynecology at the University of Washington School of Medicine who studies the role of inflammation on preterm delivery. He cautioned that vaginal seeding could be dangerous because it exposes babies to potential infectious pathogens found in the mother’s vaginal secretions, such as the herpes simplex virus, hepatitis and Group B strep. “Vaginal seeding seems natural but has these potential downsides,” he says.

Eschenbach says the Baby Biome project was a large validation study. “It backs up what others have suspected for a long time,” he says, adding that new whole genome-sequencing science allowed the researchers to learn more about gut bacteria than was possible with previous culturing methods. “This is an important area for research. The hypothesis is that it’s the very early microbes that get to the baby that might determine whether the baby’s immune system has a normal or accelerated inflammatory response.”

One lingering question is about the role of antibiotics in shaping the gut bacteria of babies born by caesarean section. Women undergoing caesarean surgery are routinely given antibiotics to reduce the impact of incision site infections, and the drugs can kill desired bacteria along with harmful microbes. “What we’re trying to do is understand how modern clinical practices impact the formation of the human ecosystem right at birth,” says co-author Trevor Lawley, a microbiome researcher at Wellcome Sanger. The babies of mothers who took antibiotics but gave birth vaginally also had lower levels of the normal bacteria—but to a lesser extent that the caesarean infants.

“This [study] suggests that the effect of caesarean delivery on the infant microbiome is related to maternal antibiotic exposure, not lack of exposure to vaginal bacteria at birth, as some have previously argued,” says Lisa Stinson, a research fellow at the University of Western Australia who has published widely on infants’ microbial exposure and immunity. She says she’d like to see more research on the role of breast milk in restoring infants’ gut bacteria.

Researchers are still working to piece together how various factors affect the gut microbiome during and shortly after birth. Previous research has identified possible differences in the development of intestinal microbes based on breast milk or formula feeding, though the method of birth may have an even more significant effect.

“We can’t be making people feel guilty because of decisions they might not have control over,” says Steven Townsend, assistant professor of chemistry at Vanderbilt University, explaining that many women need caesarean sections for medical reasons or are unable to breastfeed. His research on the infant gut microbiome found that breastfeeding can restore the gut bacteria of caesarean babies within just six weeks. Infants also receive good bacteria from other sources, such as intimate skin-to-skin contact, he says. “Although we do see differences early in life, we also see that everyone eventually arrives to the same place with the same quality of health,” he says.