Scientists say they have found a mechanism which may explain why a poor diet during pregnancy can increase the risk of offspring developing diabetes in later life.
They say rat studies indicate an imbalanced diet in the mother can lead to the "silencing" of a gene linked to insulin production in the child.
The Cambridge study is in Proceedings of the National Academy of Sciences.
Experts said it showed a healthy diet was important during pregnancy.
Scientists already suspect that a poor diet during pregnancy can result in health problems such as diabetes for the offspring in later life. What the researchers at the University of Cambridge have come up with is a possible explanation.
They believe an imbalanced diet in the expectant mother can compromise the long-term functioning of a gene in the child.
The gene, called Hnf4a, is thought to play a role in the development of the pancreas and in insulin production.
Because of the difficulties of testing the theory on pregnant women, they fed rats a protein-deficient diet and found higher rates of type 2 diabetes in the offspring, as expected.
What they also found in the offspring was that this Hnf4a gene appeared to be "silenced" or "switched off" as the rats aged. The researchers suggest this may both cause diabetes, and can be linked back to the maternal diet.
Dr Susan Ozanne of the University of Cambridge, who lead the study, said further research would be needed to establish whether high-fat diets or other imbalanced diets had similar consequences in rats.
She believes similar mechanisms to those seen in the study could occur in humans, and that the effects might be felt by more than just the immediate offspring.
"Having a healthy well-balanced diet any time in your life is important for your health," she said, "but a healthy well-balanced diet during pregnancy is particularly important because of the impact on the baby long-term and potentially even on the grandchildren as well."
Type 2 diabetes is often associated with obesity, although several inheritable genes have also been linked to the condition.
This latest study focuses on what are called the "epigenetic" mechanisms which can affect whether a gene is expressed or not. Other studies have shown that these changes can be passed across generations without any modifications to our core DNA.
Professor Jeremy Pearson of the British Heart Foundation said the research did not change the advice to pregnant women to eat a healthy, balanced diet, and said there was no reason for expectant mothers to be unduly worried.
But he said the study "adds to the evidence that a mother's diet may sometimes alter the control of certain genes in her unborn child".
Professor Douglas Kell of the Biotechnology and Biological Sciences Research Council said the research fleshed out some of the molecular processes at play.
"This study uncovers - through epigenetics and molecular biology research - an important piece of this puzzle and shows us how apparently minor changes within cells at the very earliest stages of development can have a major influence on our health into old age," he said.