Eating poor food can put you in a low mood, new research suggests.
Scientists have found a link between consuming harmful trans-fats and an increased risk of depression.
Olive oil and healthier polyunsaturated fats appear to have the opposite effect, helping to keep people cheerful.
The research may provide a clue to why southern Europeans tend to be less depressed than northerners, say the researchers.
Mediterranean diets are rich in healthy ingredients such as fish, fresh fruits and vegetables, as well as olive oil.
People in the UK and other northern European countries, on the other hand, are more likely to consume foods laden with saturated and trans-fats.
Trans-fats are modified vegetable fats used to improve shelf-life and often found in fast foods, pastries, cakes and biscuits.
They are strongly linked to raised levels of "bad" cholesterol and heart disease.
Denmark has banned all but trace amounts of trans-fats in food since 2003, and the US state of California intends to phase them out by 2011.
Although UK food manufacturers no longer use trans-fats, the ingredient can still be found in many food products imported from abroad. Trans-fats can be recognised by the food label "hydrogenated fat/oil".
The new research was carried out by Spanish scientists who studied more than 12,000 university graduate volunteers over six years, recording details of their diets, lifestyles and illnesses.
In total, 657 participants were newly diagnosed with depression during this time.
The research showed that people who ate high levels of trans-fats were up to 48pc more prone to depression than those who kept trans-fats out of their diet.
A dose response was seen, showing an association that increased as more trans-fats were consumed.
The scientists also looked at the effect of polyunsaturated fats, abundant in fish and vegetable oils, as well as olive oil.
"We discovered that this type of healthier fats, together with olive oil, are associated with a lower risk of suffering depression," said lead researcher Professor Miguel Angel Martinez-Gonzalez, from the University of Navarra.
The trend was seen despite the fact that the study population had a low average intake of trans-fats.
The ingredient made up only 0.4pc of all the calories consumed by the volunteers.
The findings were published in the online journal Public Library of Science ONE.