We show that a new measure of cognitive decline, that can be computed in longitudinal surveys where respondents perform the same recall memory tests over the years, is highly predictive of the onset of dementia. Using SHARE data, we investigate the way retirement affects cognitive decline over time controlling for age, education and other confounding factors. We find that retirement has a long-term detrimental effect on cognition for individuals who retire at the statutory eligibility age. It plays instead a protective role for those who retire on an early retirement scheme.