Previous studies indicate that occupation might affect cognitive functioning in late life. As people in low- and middle-income countries often have to work until late life, we sought to investigate if there are cognitive benefits to working later into life and whether cognitive function deteriorates after exiting the labour force. We analysed longitudinal data from the Mexican Health and Aging Study (MHAS), a nationally representative sample of Mexican adults age 50+ (N = 7,375), that assessed cognitive functioning by verbal learning, delayed recall and visual scanning. Analyses were carried out using mixed-effects modelling corrected for the influence of gender, instrumental activities of daily living, diabetes, stroke, hypertension, depression, income and marital status. Results suggest that working actively, compared to exiting the workforce, was associated with cognitive performance only in context with occupation. Domestic workers had a faster decline in verbal learning (b = −0.02, p = 0.020) and delayed recall (b = −0.02, p = 0.036) if they continued working actively and people working in administration (b = 0.03, p = 0.007), sales (b = 0.02, p = 0.044) and educators (b = 0.03, p = 0.049) had a slower decline in visual scanning if they continued working in old age. Our findings indicate that continued participation in the labour force in old age does not necessarily come with cognitive benefits. Whether or not working actively in later life protects or even harms cognitive functioning is likely to depend on the type of job.