A growing literature examines the effect of retirement on cognitive function, but pays little attention to how this relationship may depend upon the nature of retirement. Of particular importance is the growing prevalence of gradual retirement characterized by continued employment-either with a new employer or with the same employer-after retiring from a career job. We use data from men and women aged 50 or older in the Japanese Study of Aging and Retirement to examine the effects of full retirement, partial retirement with the same employer, and partial retirement with a new employer on cognitive function. Our analyses consider the moderating role of career job complexity and exploit distinctive features of the Japanese public pension and mandatory retirement systems to estimate the causal effect of retirement type on cognition. Results indicate that partial retirement with the same employer has a significant and adverse effect on cognitive function (relative to those not yet retired). In contrast, those who experienced either full retirement or partial retirement with a new employer were, on average, no different from those still in their career job. Partial retirement with a new employer has a beneficial effect on cognition among those who had a high-complexity career job. Results are consistent with the idea that novel work exposures and experiences have a beneficial effect on cognition. They also suggest that ongoing policy efforts to promote partial retirement with the same employer may have unexpected adverse implications for cognitive health.