Scientists say your daily coffee habit may do more than give you an energy boost. New research suggests that drinking a moderate amount of caffeinated coffee or tea could help lower the risk of dementia as people age. However, the benefits appear to level off after a certain point, meaning more caffeine is not necessarily better for the brain.

A large US study followed 131,821 nurses and healthcare professionals for as long as 43 years, beginning when participants were in their early 40s. Over the course of the study, 11,033 participants, about 8%, developed dementia. Researchers found that people who regularly consumed moderate amounts of caffeinated coffee or tea were less likely to develop the condition.

The strongest benefit appeared in adults age 75 and younger. In that group, consuming about 250mg-300mg of caffeine per day, equal to roughly two to three cups of coffee, was linked to a 35% lower dementia risk. Drinking more caffeine than that did not provide additional protection.

At the start of the study, women reported drinking an average of about four and a half cups of coffee or tea daily, while men averaged roughly two and a half cups. Participants who consumed more caffeinated coffee were often younger, but they also tended to drink more alcohol, smoke more, and consume more calories, all of which are associated with a higher risk of dementia.