To test the hypothesis that age at retirement is associated with dementia risk among self-employed workers in France, we linked health and pension databases of self-employed workers and we extracted data of those who were still alive and retired as of December 31st 2010. Dementia cases were detected in the database either through the declaration of a long-term chronic disease coded as Alzheimer's disease and other dementia (International Classification of Disease codes G30, F00, F01, F03) or through the claim for reimbursement of one of the anti-dementia drugs. Data were analyzed using Cox proportional hazard model adjusting for potential confounders. Among the 429,803 retired self-employed workers alive on December 31st 2010, prevalence of dementia was 2.65 %. Multivariable analyses showed that the hazard ratio of dementia was 0.968 [95 % confidence interval = (0.962-0.973)] per each extra year of age at retirement. After excluding workers who had dementia diagnosed within the 5 years following retirement, the results remained unchanged and highly significant (p < 0.0001). We show strong evidence of a significant decrease in the risk of developing dementia associated with older age at retirement, in line with the "use it or lose it" hypothesis. Further evidence is necessary to evaluate whether this association is causal, but our results indicate the potential importance of maintaining high levels of cognitive and social stimulation throughout work and retiree life.