The human body is teeming with thousands of species of microbes that affect health.
A study showed that transplanting gut bacteria from obese people into mice led to the animals gaining weight, while bacteria from lean people kept them slim.
The findings were published in Science.
Researchers at the Washington University School of Medicine, Missouri, took gut bacteria from pairs of twins - one obese, one thin.
The bacteria were then put into mice which had grown up in completely sterile environments and had no gut bacteria of their own.
Mice with the obese twin's bacteria became heavier and put on more fat than mice given bacteria from a lean twin - and it was not down to the amount of food being eaten.
There were differences in the number and types of bacteria species from the lean and obese twin.
Overall it seemed those from a lean twin were better at breaking down fibre into short-chain fatty acids. It meant the body was taking up more energy from the gut, but the chemicals were preventing fatty tissue from building up and increased the amount of energy being burned.
One of the researchers, Prof Jeffrey Gordon, told the BBC's Science in Action programme: "We don't dine alone, we dine with trillions of friends - we have to consider the microbes which live in our gut."
However, the diet was also important for creating the right conditions for the lean twin's bacteria to flourish. A bacterial obesity therapy seems unlikely to work alongside a a diet of greasy burgers.
Think you're all human? You may need to think again.
For every cell that makes up the human body there are 10 bacteria living on and in it.
This diversity of life is called the microbiome and it is no surprise that it affects our health.
There have even been some patients who have had faecal transplants in an attempt to change the nature of their gut bacteria.
Patients with C. difficile infections have an imbalance of bacteria which antibiotics sometimes fail to treat.
Some medical reports suggest that samples taken from a healthy gut and piped into the patient can cure the infection.
How big an impact adjusting the microbiome could have on our lives is still debated, but it is an exciting field of research.
Do faecal transplants have a medical role?
First census of bugs living on us
Keeping both sets of mice in the same cage kept them both lean if they were fed a low-fat, high-fibre diet. Mice are coprophagic, meaning they eat each other's droppings, and the lean twin's bacteria were passed into the mice which started with bacteria that should have made them obese.
However, a high-fat, low-fibre diet meant the mice still piled on the pounds.
A human obesity treatment is unlikely to use transplants of thousands of species of bacteria from lean people's guts as it carries the risk of also transferring infectious diseases.
Instead a search for the exact mix of bacteria which benefit weight - and the right foods to promote their growth - is more likely.
Prof Gordon said the next steps in the field would be "trying to figure out how general these effects are, what diet ingredients may promote their beneficial activities and to look forward to a time when food and the value of food is considered in light of the microbes that live in our gut - that foods will have to be designed from the inside out as well as from the outside in."
Commenting on the research, Prof Julian Parkhill, from the Wellcome Trust Sanger Institute, said he expected a future when manipulating bacteria was a part of obesity treatment.
"There's a lot of work to do, but this is proof of concept that bacteria in the gut can modulate obesity in adults, but it is diet-dependent," he said.
He added that changing bacteria was a promising field for other diseases.
He told the BBC: "It's an exciting new area, but I think we need to be careful in promoting it as a cure-all.
"It's clear in specific areas - inflammatory bowel disease, obesity, Crohn's - the microbiome is going to be important."
Bacteria living in our guts seem to be affecting our waistlines and harnessing them could lead to new ways of shedding the pounds, US research suggests.