Scientists have shown that women with high levels of vitamin B12 in early pregnancy are three times more likely to have contented, quiet infants.
Meanwhile, those with the lowest levels are far more likely to have babies that cry for at least three hours a day.
Doctors say the study is the first to show a link between colic and a mother’s nutrition – but stress it is too early to recommend that pregnant women change their diets.
But there are concerns that a large number of meat-eaters are also missing out on the vitamin in their diets.
The new research by Dutch scientists looked at levels of vitamin B12 in the blood of more than 4,000 women during the 12th week of pregnancy.
The researchers compared the results with a questionnaire filled in by the women around three months after their babies were born.
Around five per cent of the women who had the lowest levels of vitamin B12 complained that their babies cried excessively – compared to just one per cent of the mothers who had the highest levels.
Women with the lowest vitamin B12 levels were more likely to have colicky babies even when other factors – such as their age, social background, smoking and education – were taken into account, the researchers report in the Early Human Development journal.
They found no link between folate, another nutrient essential for the healthy development of brains, and crying.
Researchers believe a lack of vitamin B12 may affect the development of nerve cells in the brain, increasing irritability in babies.
It could also interrupt the natural sleep cycle of infants, because low levels prevent the release of the sleep hormone melatonin.
But nutrition experts warned that some sources of the vitamin pose risks to pregnant women.
They are told to avoid liver, raw eggs, soft cheese and shellfish, which all contain vitamin B12.
Vitamin B12 is known to play a key role in the development of the brain and nervous system in unborn babies and is also essential for healthy blood.
It is found in red meat, chicken, dairy products and fortified breakfast cereals, along with liver and shellfish – two foods that pregnant women are specifically advised to avoid.
Vegetarians and vegans are particularly vulnerable to vitamin B12 deficiency – a condition that leads to anaemia, tiredness, weight loss and constipation.