There are plenty of ways to keep our brains active and healthy as we age. Eating leafy vegetables, doing crossword puzzles, and listening to music are among activities doctors recommend. Now, a recent study published in the journal Age and Ageing found that having an active sex life over age 50 can boost brain health, and eventually protect us from dementia.

There has been little focus on how having sex into old age affects cognition. Yet, we know sex influences the social, emotional, and physical aspects of our lives in general. Dr. Hayley Wright and Rebecca Jenks of Coventry University sought to examine the possible benefits of sex in old age.

The researchers analyzed over 6,800 participants between the ages of 50 and 89 to see how and if sex had any effect on the aging process. The participants were asked about their sex lives, including everything from masturbation to intercourse. A series of experiments were conducted to test the brain health of the participants.

In the first experiment, participants were asked to read a series of words, and then to remember them under two different circumstances — immediately after reciting them, and five minutes after hearing them. The second experiment included a number sequencing exercise where participants were given a specific pattern of numbers, and then asked to recall which digit was missing (e.g. 1, 2, __, 4). The researchers took into account age, education, wealth, levels of physical activity, cohabiting status, general health, depression, loneliness, and quality of life when it came to factors that could influence sexual activity or cognition.

The findings revealed those with active sex lives were more likely to accurately recall both the word and number tests than were those who reported being sexually inactive. Men fared better than women on some aspects of the testing too. Sexually active men showed a higher difference in score on both tests than sexually active women did. These women did show a significant improvement in word recall, but not the number sequencing test.

So, how is being sexually active good for the brain?

The researchers speculate that sex increases levels of the feel-good hormones dopamine and oxytocin in the brain. These brain chemicals may be vital to brain function through “improving signaling or connectivity between brain regions,” Weight told AARP. This could offer insight as to why those in healthy committed relationships have better brain health.

The disparity between how well men and women performed on the experiments could be attributed to sex-specific hormones. These hormones circulate within our bodies before we are even born, and can actually impact brain development and cognitive function throughout our lifetime. Previous studies suggest hormonal differences in men and women lead them to use different parts of the brain to encode memories, sense emotions, recognize faces, solve certain problems, and make decisions.

“Whilst our research is not concerned with how men and women `think’ about sex in a conscious sense, it is possible that our results may be related to hormones which affect the brain — and hence cognitive functions — in men and women differently, at a subconscious level,” Wright told Reuters Health.

Most research related to sex and cognitive function has solely focused on men. A 2000 study found healthy older Italian men over 65, who were still interested in sex and were sexually active, had better cognitive function than those who were not. The lack of research with women in this area could be because they are more likely to be widowed at an earlier age than men.

Overall, Wright’s and Jenks’ study does prompt further research when it comes to preventing age-related cognitive decline. There’s plenty of lifestyle factors that promote or protect cognitive functions, especially memory, in old age. With about 44 million people diagnosed with Alzheimer’s or a related dementia, sex could be beneficial to our overall mental health.

Sources: Wright H and Jenks RA. Sex on the brain! Associations between sexual activity and cognitive function in older age. Age and Ageing. 2016.

Padoani W, Dello Buono M, Marietta P et al. Influence of Cognitive Status on the Sexual Life of 352 Elderly Italians Aged 65–105 Years. Gerontology. 2000.