A diet rich in the nutrient, choline, may help protect your brain from the effects of ageing.
The nutrient is prevalent in foods such as chicken, eggs, fish and milk as well as certain legumes such as soy and kidney beans.
Researchers found that those with plenty of choline in their diets performed better in memory tests and were less likely to show brain changes associated with dementia than those with a low choline intake.
The findings suggest that your lifetime diet may have an impact on how your brain ages, said senior researcher, Rhoda Au, of Boston University School of Medicine.
However, Au warned that no one nutrient is a magic bullet against demetia.
"I think the message is that eating a healthy, balanced diet in mid-life is important," she said.
The researchers looked at data from a long-running heart health study. Almost 1,400 adults ages 36 to 83 were asked dietary questions between 1991 and 1995. Then, between 1998 and 2001, they underwent tests of memory and other cognitive abilities, and had MRI brain scans.
The study found that those in the top quarter for choline intake performed better on the memory tests than those in the bottom quarter, even when factors such as education and fat and calorie intake were taken into consideration.
Dr Au said the findings suggest that people with lower choline intakes were more likely to be on a "pathway" toward mental decline than those who consume little choline in their diet.
Find out which other foods are known to sharpen your memory and aid concentration, below: