Feel like you have cobwebs in your brain? Here’s a rewarding and scientifically proven way to clear them—do a certain kind of volunteer work. You already know about the feel-good aspects of doing good in your community. You also may have heard that people who give the gift of their time are healthier and less likely to suffer from depression.

The latest: Volunteering can boost your brainpower—and potentially ward off Alzheimer’s disease.

Background: Physical exercise is a well-established way to reduce your dementia risk. There also is evidence that having an active social life and staying intellectually engaged is important. For many people, volunteering encompasses all three. So researchers set out to study what effects a real-world, long-term volunteering program has on dementia risk.

Study: Researchers recruited 111 men and women, average age 67.2 years, to participate in the Brain Health Study (BHS), part of the larger Baltimore Experience Corps Trial, which now is an AARP program that brings retired people into public schools to serve as mentors to young children and to help them learn to read. The participants received 30 hours of training and were expected to volunteer for five to 15 hours a week during the school year. The other half, the control group, were on the “wait list” for the Corps and instead directed to occasional, short-term, low-physical-activity volunteer opportunities. All participants in the BHS underwent MRI brain scans and took memory/cognitive tests at the beginning of the study, at 12 months and at 24 months post-volunteering.

Results: As we age, it’s normal for our brains to shrink in size a small amount each year, which is related to a reduction in memory and mental sharpness. That happened to the control group—but not to the Experience Corps volunteers. Their brains stayed the same size or grew, especially the hippocampus, a brain region essential to memory. That’s an important finding because a decrease in hippocampal volume is linked to an increased risk of developing Alzheimer’s disease. The benefits were more pronounced for men—the equivalent to having a brain that was on average three years younger than when they started volunteering. Women’s brains benefited, too, just not as much. For both men and women, the more their brains benefited in size, the better they did on memory and cognition tests.

While this kind of study can’t identify which elements were most important, the researchers emphasize that the program increases involvement in many beneficial activities—physical, social and cognitive—that retired people may not have engaged in to the same degree otherwise. Participants needed to get up fairly early in the morning, commute to the school, walk up and down stairs in the school and just generally keep up with active elementary-school kids. They worked in teams, shared their knowledge, engaged in problem-solving and socialized in new ways. The relationships they formed with the children were important, but the researchers believe that the same benefits might be seen from active, mentally engaging interaction with patients at a hospital, animals at a humane society or fellow volunteers in many other realms.

The bottom line: Participating in any type of mentally engaging, physically active, sustained volunteer activity in your community will probably have long-term benefits for your cognitive health.