A diet, high in fats, sugars, and processed foods in early childhood is associated with lowering IQ, while a diet packed full of vitamins and nutrients does the opposite, research suggests.
Toddlers fed a diet packed high in fats, sugars, and processed foods had lower IQs than those fed pasta, salads and fruit, it was found.
The effect is so great that the researchers said those children with a "healthier" diet are thought to get an IQ boost.
Scientists stressed good diet was vital in a child's early life as the brain grows at its fastest rate during the first three years of life.
This indicated head growth at this time is linked to intellectual ability and "it is possible that good nutrition during this period may encourage optimal brain growth".
Scientists tracked the long term health and wellbeing of around 14,000 children born in 1991 and 1992 as part of the West Country's Avon Longitudinal Study of Parents and Children (ALSPAC).
Parents were quizzed about the types and frequency of the food and drink their children consumed when they were three, four, seven and eight and a half years old.
They were marked on a sliding scale which ranged from minus two for the most healthy to 10 for the most unhealthy.
Three dietary patterns were identified: "processed" high in fats and sugar intake; "traditional" high in meat and vegetable intake; and "health conscious" high in salad, fruit and vegetables, rice and pasta. Scores were calculated for each pattern for each child.
IQ was measured using a validated test - the Wechsler intelligence Scale for children - of 4,000 children when they were eight and half years old.
The results found after taking account of potentially influential factors, a predominantly processed food diet at the age of three was associated with a lower IQ at the age of eight and a half, irrespective of whether the diet improved after that age.
Every 1 point increase in dietary pattern score was associated with a 1.67 fall in IQ. On the other hand, a healthy diet was associated with a higher IQ at the age of 8.5, with every one point increase in dietary pattern linked to a 1.2 increase in IQ. Dietary patterns between the ages of four and seven had no impact on IQ.
Although a modest increase, the scientists said the study's findings were in line with previous ALSPAC research that linked early childhood diet and later behavior and school performance.
"This suggests that any cognitive and behavioral effects relating to eating habits in early childhood may well persist into later childhood, despite any subsequent changes - including improvements - to dietary intake," they say.
The brain grows at its fastest rate during the first three years of life, say the authors, by way of a possible explanation for the findings, adding that other research has indicated that head growth at this time is linked to intellectual ability.
"It is possible that good nutrition during this period may encourage optimal brain growth," they suggest.
The brain is made entirely from molecules derived from food, air and water, so it makes sense that diet can affect how effectively the brain works. In children, good nutrition is especially important because the brain is still growing, so feeding the brain with healthy foods and avoiding highly processed 'junk food' and sugar, helps the brain to develop properly.
Research Paper Details:
K. Northstone, C. Joinson, P. Emmett, A. Ness, T. Paus. Are dietary patterns in childhood associated with IQ at 8 years of age? A population-based cohort study. Journal of Epidemiology & Community health, 2011.