Middle-aged men now have a good excuse to go to the pub with their mates - it is good for their brains.
A drink with friend can help the brain
Researchers say that social activities, such as evening classes, chess and even going to the pub can help maintain mental agility.
Middle-aged women appeared to benefit slightly less from the same activities.
The team from University College London say their work shows that people should not simply resign themselves to losing cognitive skills as they age.
Researchers questioned about 5,350 civil servants aged between 35 and 55 about their leisure habits.
They were asked if they participated in any of 13 activities, ranging from those which required a low cognitive effort - such as DIY and housework - to those which required high cognitive effort - such as cultural visits and evening classes.
Participants were then given recognised cognition tests in verbal memory, mathematical reasoning, vocabulary and verbal fluency.
Taking part in activities which needed a high level of concentration or social interaction were associated with better cognitive ability than individual activities which needed little effort.
Men also seemed to benefit more from these kind of activities than women - perhaps, say the researchers, because women get their cognitive stimulation from social interactions more linked to caring activities which were not covered in the research.
They conclude that seeking mental stimulation may have a beneficial effect on cognition in middle age.
Dr Archana Singh-Manoux, who led the research, told BBC News Online: "There are some people who believe that our cognition is not a flexible entity, that the neurons are fixed and that you gradually lose connections."
She said her research showed that different activities did influence cognition.
"We believe that what you do will matter, it will matter throughout your life.
"Middle-aged people should ensure that they remain active and remain engaged."
She added that while a quick pint with friends would be beneficial, drinking to excess was not.
"Moderate levels are always good," she said.
The research is published in the Journal of Epidemiology and Community Health.