Researchers say they could drink a cup of coffee every morning to ward off dementia and Parkinson's.
The benefits are particularly strong for people who opt for darker roasted beans – even when decaffeinated, the study found.
Coffee roasting releases chemicals that counteract the proteins responsible for causing the disease, scientists have discovered.
It's not a cure or a clear prevention for any of the diseases, but the researchers say it does not hurt to add a cup to your daily routine, the Daily Mail reports.
Roasting coffee beans triggers the release of phenylindanes, a group of compounds that prevent the "clumping" of proteins common in Alzheimer's and Parkinson's.
Alzheimer's disease develops when these proteins, beta-amyloid and tau, clump together between the neurons.
Study Director Donald Weaver, co-director of the Krembil Brain Institute in Canada, said: "Coffee consumption seems to have some correlation with a reduced risk of developing Alzheimer's disease and Parkinson's disease.
"But we wanted to investigate why this is so, what are the substances and how they can influence the age-related cognitive decline.
"The caffeinated and the decaffeinated dark roast both had identical potencies in our first experimental tests.
"So we saw early that its protective effect was not due to caffeine."
Dr. Weaver and his co-researchers Ross Mancini and dr. Yanfei Wang tested the Phenylindane values for light roast, dark roast and decaffeinated dark roasted coffee.
They found that the more coffee was roasted, the higher the concentration of the chemical – and the level of protection.
Dr. Weaver said, "Phenylindanes are a dual inhibitor, very interesting, we did not expect that."
Dr. Mancini added, "This is the first time anyone has studied how phenylindanes interact with the proteins responsible for Alzheimer's and Parkinson's.
The next step would be to examine how beneficial these compounds are and whether they have the ability to penetrate the bloodstream or cross the blood-brain barrier.
"The fact that it is a natural remedy for synthetic material is also a great advantage," said Dr. Weaver.
He said, "Mother Nature is a much better chemist than we and Mother Nature can make these connections.
"If you have a complicated connection, it's nicer to plant them in a crop, harvest the crop, grind and extract the crop than try."
However, they need further research before they can realize potential therapeutic options.
Dr. Weaver added, "What this study is doing is epidemiological evidence, trying to refine it and showing that there are actually components in coffee that help prevent cognitive decline.
"It's interesting, but do we suggest that coffee is a cure? Absolutely not."