It also involves a low consumption of processed food, processed carbohydrates, sweets and chocolate and red meat.
As part of the study, Australian researchers recruited a total of 82 adults with depression, aged between 18 -65.
They assessed their mental health and quality of life using two official scales: the Depression Anxiety Stress Scales (DASS) and the Positive and Negative Affect Scale (PANAS).
They then assessed how strongly they followed the Mediterranean diet through a 14-item questionnaire.
The study's lead author, Dr Natalie Parletta, of the University of South Australia, said there was a strong link between the Mediterranean diet and lower scores for mental illness.
This was despite the fact it was a study of people with depression, who tended to have poor diets in the first place.
She told MailOnline: "What we found is that poor diet is predicting the onset of depression.
"It's not that people are getting depressed and then eating badly, eating badly causes the depression in the first place.
"We recruited people who had depression already. We screened out people who had good diet.
"So it was amazing that there was a significant correlation the Mediterranean diet and mental illness, even for people with low scores on the consumption of wholefoods."
She said research shows there is an overlap between heart disease and depression, and scientists have begun to think there might be common underlying mechanisms.
Inflammation and insulin resistance which occurs in the body and causes heart disease could also cause depression in the brain, she said.
"The brain is an organ like any other," she explained.
"It has higher needs than other organs, from bloodflow to delivering oxygen, glucose and nutrients.
"A lack of bloodflow and inflammation can affect the brain as much as any other organ."
A Mediterranean diet is high in nutrients such as omega-3, vitamin B, vitamin D, healthy fats and anti-oxidants, she said, which are all important for keeping the brain functioning well and staving off mental illness.
There has been a lot of research on how omega-3 fatty acids, found in fish, play a vital role in maintaining or improving mental health and stability.
Deficiency in these nutrients can impair the brain's functioning and lead to depression, she added.
"There are many challenges in life, and factors that lead to depression. But by developing a strong foundation for our brain to function well through providing it with key nutrients, we're better able to deal with life's challenges," she said.
"And it's not just the nutrients - the fibre is also beneficial. Highly fibrous foods means you're not getting mood swings through sugar.
"Sometimes depression is biological. It could be a wheat allergy, it's rarely known that an intolerance can lead to depression and even bipolar.
"Depending on the person, a deficiency could be the key link to what is causing mental illness."
On the other hand, a poor diet can lead to depression, stress and anxiety, she said.
She explained hat highly processed foods, red meat and confectionary increase our blood glucose levels, leading to sensitivity to insulin - the hormone that controls how much sugar is in our blood - and obesity.
This inflammation affects the brain, causing mental illness.
When a person is stressed and anxious, they go into a "fight or flight" mode in which stress hormones are released, making the body more aroused and responsive, shifting blood from the skin to the muscles, and raising heart rate.
This shuts down digestion and healing.
"If you're in a state of stress, your body isn't absorbing as many nutrients as possible, so the need for nutrients is increased," Dr Parletta said.
"You'll be in a better state to replenish the nutrients if you're eating a nutrient-rich Mediterranean diet.
"So no stress is best of all, but a Mediterranean diet with stress is better than a poor diet with stress."
The results indicate that dietary intervention may improve mental health and so the researchers are seeking more volunteers to further examine the ability of diet combined with fish oil supplementation to improve mental health.
They are now looking for volunteers aged 18-65 in Adelaide who have depression, to investigate this further.
- Daily Mail