Eating loads of fruit and vegetables might not sound appealing to many teenagers but it could help protect them from mental health problems.
A study of 3000 adolescents has found that those who had poor diets filled with junk and processed foods were more likely to suffer mental health problems such as depression and anxiety.
While other studies have shown links between diet quality and mental health disorders in adults, the new research is the first to demonstrate the link in adolescents.
Dr Felice Jacka, from Deakin University's Barwon Psychiatric Research Unit, said the finding suggested it could be possible to stop some mental health problems developing in adolescents by ensuring they ate healthy diets.
"The results of this study are consistent with what we have seen in adults but we think it could be more important because three quarters of psychiatric illnesses start before adulthood and once someone has depression they are likely to get it again," Dr Jacka told AAP.
"If you can prevent it before it starts in childhood and adolescence you are shutting the gate before the horse bolts.
"Having good nutrition-rich foods is really important for adolescents because it's a time when they are growing rapidly and it's essential they have adequate nutrition."
One in five Australian adolescents have some form of mental health problem.
Genes and environmental factors such as stressful events in early childhood are already known to play a role.
Where diet fits in is through its influence on genes, the immune system and the main brain proteins linked to mental health problems.
In her study Dr Jacka analysed data from more than 3000 Victorian adolescents aged 11 to 18.
The participants filled in questionnaires about their diets and psychological symptoms in 2005 and again in 2007.
Those who ate healthy diets in 2005 were found to have fewer mental health problems than those with poor diets.
Those who improved their diets by eating more healthy foods between 2005 and 2007 also had better mental health than those who had an unhealthy diet during that period.
Other factors that could be associated with diet quality and mental health - such as the adolescent's socio-economic status, age, gender, exercise levels and weight - were also taken into account but were not found to have any effect on the results.
Dr Jacka said parents could protect children against mental health problems by following national guidelines for eating two serves of fruit and five serves of vegetables a day, as well as sticking to wholegrains and lean meats while avoiding junk food.
But she said it was also vital for government restrictions on the access to and marketing of junk foods.
"We know depression and anxiety have a very early age of onset and they are common in adolescents and it looks like quality of their diets could be linked to a risk of mental health problems," she said.
"The results suggest we shouldn't just be looking at obesity as a potential outcome of poor diet, we need to look at mental health and physical health as potential outcomes."
Dr Jacka's study was published on Thursday in the journal PLoS One.