Children who are fed a healthy diet early in life tend to have higher scores in IQ tests, a new study from Australia says.

Researchers found an association between the kinds of food a child ate, healthy or junk, and the IQ level of the children.

The study was based on the analysis of eating behavior in approximately 7,000 children. Children's food habits were monitored when they were 6 months, 15 months and 2 years of age. These kids were then given an IQ test at age eight.

Researchers found that children who were fed breast milk in the first few months followed by healthy diet of fruits, vegetables and legumes scored, on average, two points more than other kids of the same age.

According to the researchers, avoiding chocolates might be a good idea as "children who had a diet regularly involving biscuits, chocolate, lollies, soft drinks and chips" early in life scored less in IQ test.

Experts advise that breast milk must be given to babies until they are 6 months old and generally advise against use of baby foods at least in the first year of child development.

"We also found some negative impact on IQ from ready-prepared baby foods given at six months, but some positive associations when given at 24 months," Dr. Lisa Smithers from University of Adelaide, lead author of the study said in a news release.

A related study published last year had also said that early childhood food intake has an impact on the IQ scores of a child. Brain scans of babies have also revealed the effect of early nourishment on human brain, especially in males.

Researchers say that the study shows a link between food habits and IQ, and that parents must be aware of what they're feeding their child.

"While the differences in IQ are not huge, this study provides some of the strongest evidence to date that dietary patterns from six to 24 months have a small but significant effect on IQ at eight years of age," Smithers said.

"It is important that we consider the longer-term impact of the foods we feed our children," Smithers said.

The study is published online in the European Journal of Epidemiology.