Gut bugs that love junk food may sabotage attempts to eat more healthily, research suggests.

Bacteria that inhabit a person's intestines have a big influence on dietary responses, a study has shown.

Scientists believe after years of eating fatty and sugary food, people can end up with the "wrong" sort of gut bugs that block the benefits of changing diet.

Conversely, the "right" microbes accumulate over time as a response to consumption of mainly plant-based foods.

Lead researcher Dr Jeffrey Gordon, from Washington University in St Louis, US, said: "If we are to prescribe a diet to improve someone's health, it's important that we understand what microbes help control those beneficial effects.

"And we've found a way to mine the gut microbial communities of different humans to identify the organisms that help promote the effects of a particular diet in ways that might be beneficial."

The scientists took faecal samples from people who followed either a calorie-restricted, plant-rich diet or an unrestricted average American diet.

Human bugs from the samples were then introduced to germ-free mice which were fed both kinds of menu.

Metabolic indicators showed that mice conditioned by the American diet bugs responded weakly to a plant-based diet, but their responses improved markedly when their gut bacteria were replaced with those from people used to eating plant-based food.

Dr Gordon added: "We have an increasing appreciation for how nutritional value and the effects of diets are impacted by a consumer's microbiota.

"We hope that microbes identified using approaches such as those described in this study may one day be used as next-generation probiotics. Our microbes provide another way of underscoring how we humans are connected to one another as members of a larger community."

The research is published in the journal Cell Host & Microbe.