Scientists working out of Spain's top government science body CSIC found the link by analyzing the gut flora of people with normal weight, obese people and people on antibiotics.
They found that the intestinal flora of obese people and people on antibiotics changed so that both groups had similar problems when it comes to metabolizing sugars.
"The study suggests the development of obesity and long-term antibiotics treatment change the intestinal flora to make enzymes more active," researcher Manuel Ferrar told Spanish science news agency SINC.
"This favours the rapid and unbalanced take-up of carbohydrates which, in turn, adds to the development of obesity, eating disorders and, eventually, diabetes."
The Spanish study published in the journal Gut Microbes lays the groundwork for future research into possible personalized diets which could ensure people have healthy intestinal flora.
This in turn could reduce the risks of weight gain associated with antibiotics use.
The human intestine is alive with trillions of bacteria known as intestinal flora or microbiota.
"These bacteria can carry out activities and provide molecules that we can't obtain ourselves and which are vital for the correct development of the human body," said Ferrer.
Ferrer said age, geographic origin, diet, pregnancy and obesity could have a significant impact on intestinal flora.
Antibiotics could also change the make-up of this flora, the scientist said.