The research, published in the journal Nature, showed that the number and kinds of bacteria and even the way the bacteria behaved changed within a day of switching from a normal diet to eating either animal- or plant-based foods exclusively.
"Not only were there changes in the abundance of different bacteria, but there were changes in the kinds of genes that they were expressing and their activity," said study author Lawrence David, an assistant professor at the Institute for Genome Sciences and Policy at Duke University.
The study suggests that this bacterial community and its genes called the microbiome are extraordinarily flexible and capable of responding swiftly to whatever is coming its way.
"The gut microbiome is potentially quite sensitive to what we eat," David said. "And it is sensitive on time scales shorter than had previously been thought."
David said, however, that it's hard to tease out exactly what that might mean for human health.
"It's nice to have some solid evidence now that these types of significant changes in diet can impact the gut microflora in a significant way," said Jeffrey Cirillo, a professor of microbial and molecular pathogenesis at the Texas A&M Health Science Centre College of Medicine in Bryan, Texas. "That's very nice to see, and it's very rapid. It's surprising how quick the changes can occur."
Cirillo said it was also intriguing how fast the microbiome seemed to recover. The study found that gut bacteria were back to business as usual about a day after people stopped eating the experimental diet.
For the study, researchers recruited six men and four women between the ages of 21 and 33.
For the first four days of the study, they ate their usual diets. For the next five days, they switched to eating either all plant-based or all animal-based foods. They then went back to their normal eating habits before switching to the other diet pattern.
The animal-based diet resulted in the biggest changes to gut bacteria. It spurred the growth of 22 species of bacteria, while only three bacterial species became more prominent in the plant-based diet.
The researchers don't fully understand what the shifts mean, but, they said, some made sense.
For example, several types of bacteria that became more prevalent with the animal-based diet are good at resisting bile acids. The liver makes bile to help break down fat.
Another type of bacteria, which became more common in the plant-based diet, is thought to be sensitive to fibre intake.
The researchers speculated that the bacterial shifts might explain why fatty diets have been linked to diseases like Crohn's and ulcerative colitis. More studies are needed, however, before they can say for sure.
Find out more information on overweight and obesity here.
For more on overweight and obesity, visit the Human Microbiome Project.