If a pregnant woman has a poor diet it may increase her child's chances of having heart disease, scientists say.
Women are advised to eat a balanced diet while pregnant
A University of Southampton team found blood flow through the unborn baby's liver in late pregnancy was crucial.
Their study in Circulation Research found more blood flows through the livers of babies who have slim mothers or who eat unbalanced diets.
This can affect liver function in later life, increasing the risk of heart disease and diabetes in the offspring.
Researchers from the University of Southampton, along with colleagues from Bergen and Oslo, looked at how a mother's diet and slimness could have long-term effects on a developing baby.
They used ultrasound to measure the blood flow to the liver of the developing baby in late pregnancy in 381 mothers-to-be.
They found that babies of slimmer mothers, who have lower body fat stores, and those eating an unbalanced diet have greater liver blood flow and divert less blood away from the liver in late pregnancy.
It is suggested that this changes blood flow through the liver, and may cause subtle changes in its development and alter the baby's ability to cope with a high-fat "Western" diet in later life, thereby predisposing to adult heart disease and diabetes.
The research suggests that improving a mother's nutrition before she conceives could have lifelong benefits for the health of her baby.
By measuring the growth and development of the babies during the pre-school years the researchers hope to identify whether or not the liver blood flow adaptations in the womb have long-term implications.
Dr Keith Godfrey, of the Medical Research Council (MRC) Epidemiology Resource Centre at the University of Southampton's School of Medicine, who led the study, said: "During pregnancy, the developing baby is wholly dependent upon the mother for an adequate and appropriate supply of nutrients.
"This research is the first work to recognise that a mother's slimness and diet alter the circulation of blood in her developing baby in the womb.
"As a mother's slimness and unbalanced diet during pregnancy have been linked with susceptibility to heart disease and diabetes in the offspring in later life, the findings may have important implications."
He added: "The observations suggest that before birth many normal babies adapt to the supply of nutrients from the mother and alter the amount of blood flowing to the liver.
"We believe that this 'liver-sparing' adaptation could help the baby to continue growing in the womb, even if the mother's body is not able to supply the nutrients needed by the baby.
"However, the adaptations could have long-term consequences for how the liver deals with fat and other nutrients after birth."
Dr Guttorm Haugen, of the Department of Obstetrics and Gynaecology at the University of Oslo, who also worked on the study, added: "The concept of 'liver-sparing' could lead to new diagnostic measures to investigate how maternal slimness and unbalanced diet increase the risk of adult heart disease and diabetes in the offspring."
Dr Charmaine Griffiths, spokesperson for the British Heart Foundation, which supported the study, said: "This study continues to add to our understanding of how a mother's diet can significantly affect the health of the child.
"It shows how important it is for women to eat a balanced diet packed full of fruit and vegetables, before and during pregnancy.
"Although the importance of a good diet is clear, further research is needed to understand the effects of nutrition on human development."