Eating foods containing certain types of fat may be damaging to the brain, according to Harvard researchers who linked “bad” fats like saturated or trans-fats to significantly worse memory and overall cognitive function.

While it has long been known that eating too many foods containing saturated fats or trans fat is bad for the heart, findings published online Friday in the Annals of Neurology, a journal of the American Neurological Association and Child Neurology Society, found that saturated fat was significantly associated with cognitive and memory decline in women over time.

Conversely, eating more “good” monounsaturated fat, found in foods like nuts, olives and avocados, were associated with improved brain function and memory, leading researchers to suggest that fats may have the same effect on the brain as they do on the heart.

"When looking at changes in cognitive function, what we found is that the total amount of fat intake did not really matter, but the type of fat did," explained Dr. Olivia Okereke of the BWH Department of Psychiatry in a statement.

Investigators analyzed data of a subset of 6,183 over the age of 65 who were participants in the Women's Health Study.

These women had taken three cognitive function tests every two years over an average span of four years, and had dilled out detailed food questionnaires at the start of the study, before cognitive testing.

Study results showed that over time women who consumed the highest amounts of saturated fats had the worse overall brain function and memory, compared to women who ate the least.

Additionally, women who ate the most monounsaturated fats scored the highest on the cognitive tests over the four-year study period.

"Our findings have significant public health implications," said Okereke in a statement. "Substituting in the good fat in place of the bad fat is a fairly simple dietary modification that could help prevent decline in memory.”

Researchers stressed that it is particularly important to engage in strategies that prevent or stall cognitive decline associated with aging because even subtle declines in cognitive functioning can lead to higher risk of developing serious conditions like dementia and Alzheimer’s disease.