ABSTRACT Using a life course approach, we examined how sexuality is related to cognitive function for partnered older adults. We utilized longitudinal data from two rounds of the National Social Life, Health, and Aging Project (NSHAP) to analyze 1,683 respondents. Cognitive function was measured using a continuous Montreal Cognitive Assessment (MoCA) score. We considered both sexual frequency and sexual quality (i.e., physical pleasure, emotional satisfaction). We estimated cross-lagged models to consider the potential reciprocal relationship between sexuality and cognitive function. Results indicated that sexuality was not related to later cognitive function in the total sample, but the pattern varied by age and gender. For adults aged 62–74, better sexual quality (i.e., feelings of physical pleasure and emotional satisfaction) was related to better cognitive functioning, while for those aged 75–90, more frequent sex was related to better cognitive functioning. Feelings of physical pleasure were related to better cognitive functioning for men but not women. There was no evidence of cognitive functioning being related to later sexuality. The findings highlight the importance of age and gender in modifying the link between sexuality and cognition in later life.