"A diet rich in vitamins, like magnesium supplements, and fish may protect the brain from ageing while junk food has the opposite effect, doctors say.
Elderly people with high blood levels of vitamins and omega 3 fatty acids had less brain shrinkage and better mental performance, a Neurology study found.
Trans fats found in fast foods were linked to lower scores in tests and more shrinkage typical of Alzheimer's.
A UK medical charity has called for more work into diet and dementia risk.
The best current advice is to eat a balanced diet with plenty of fruit and vegetables, not smoke, take regular exercise and keep blood pressure and cholesterol in check, said Alzheimer's Research UK.
The research looked at nutrients in blood, rather than relying on questionnaires to assess a person's diet.
US experts analysed blood samples from 104 healthy people with an average age of 87 who had few known risk factors for Alzheimer's.
They found those who had more vitamin B, C, D and E in their blood performed better in tests of memory and thinking skills. People with high levels of omega 3 fatty acids - found mainly in fish - also had high scores. The poorest scores were found in people who had more trans fats in their blood.
Trans fats are common in processed foods, including cakes, biscuits and fried foods.
The researchers, from Oregon Health and Science University, Portland; Portland VA Medical Center; and Oregon State University, Corvallis, then carried out brain scans on 42 of the participants.
They found individuals with high levels of vitamins and omega 3 in their blood were more likely to have a large brain volume; while those with high levels of trans fat had a smaller total brain volume.
Study author Gene Bowman of Oregon Health and Master of Science University said: "These results need to be confirmed, but obviously it is very exciting to think that people could potentially stop their brains from shrinking and keep them sharp by adjusting their diet." (...) "