The study looked at 145 babies and their mothers, who were quizzed about their eating habits between 24 and 28 weeks pregnant.

London - Eating healthily during pregnancy could protect babies from allergies by changing their gut bacteria, according to a study.

It found women who eat more fish and seafood have children who appear to have a healthier mix of gut bugs. But the research suggests eating dairy food can reduce levels of bifidobacterium, which is seen as beneficial for health.

The study looked at 145 babies and their mothers, who were quizzed about their eating habits between 24 and 28 weeks pregnant.

The importance of diet for babies in the womb relates to the balance of gut bacteria, which needs to be constant to maintain a strong immune system. An imbalance has been linked to problems with food such as peanut and dairy allergies.

Sara Lundgren, lead author of the study from Geisel School of Medicine at Dartmouth College in the US, said: "Our study demonstrates an association of a readily modifiable factor – maternal diet – with the infant gut microbiome [environment]. This knowledge may be key for developing evidence-based dietary recommendations for pregnant and lactating women."

The research, published in the journal Microbiome, found babies delivered by Caesarean appear to have a healthier balance of gut bacteria if their mothers ate more fish and seafood.

Surprisingly, however, the study found that eating healthy fruit may cut levels of beneficial bifidobacterium in babies born naturally, while a diet high in red and processed meat increases it in those born by Caesarean. The effect on babies may come through mothers passing on their own gut bacteria, or the pregnancy diet changing how babies respond to microbes.

Previous evidence has shown that a Mediterranean diet during pregnancy, high in fruit and vegetables, can cut the chances of wheeziness in children.

Diet appeared in the most recent study to be more important when babies were exclusively breastfed.

The study concludes: "The gut microbiome has an important role in infant health and immune development and may be affected by early-life exposures."