Background: depression is associated with poor cognitive function, though little is known about the relationship between psychological well-being and cognitive function. Objective: to investigate whether psychological well-being is associated with levels of cognitive function. Design: nationally representative population-based cohort study. Setting and participants: 11,234 non-institutionalised adults aged 50 years and over of the English Longitudinal Study of Ageing in 2002. Methods: psychological well-being was measured using the CASP-19, and cognitive function was assessed using neuropsychological tests of time orientation, immediate and delayed verbal memory, prospective memory, verbal fluency, numerical ability, cognitive speed and attention. The relation of psychological well-being to cognitive function was modelled using linear regression. Results: on a global cognitive score combining all cognitive tests, those in the fifth quintile of psychological well-being scored an average of 0.30 SD units higher than those in the lowest quintile (95% CI 0.24-0.35) after adjustment for depressive symptoms and sociodemographics. This association remained after additional adjustment for physical health and health behaviours. The same pattern of association was observed for men and women, and across all cognitive domains. Conclusions: in a large population of community living adults, higher levels of psychological well-being were associated with better cognitive function.