Few modifiable risk factors for cognitive decline have been identified. Despite an external locus of control (LoC) being adversely associated with many psychological and physical health outcomes, few studies have examined whether it is related to cognitive function in adulthood. In 1178 women from the Avon Longitudinal Study of Parents and Children, we examined whether LoC, and change in LoC over time, is associated with cognitive function in midlife. LoC was prospectively measured at mean ages 30 and 48 years using the validated Nowicki-Strickland scale. Cognitive function was examined at mean age 51 years. At both time points, greater externality was associated with lower cognitive function. For example, the group of women classified as being external at mean age 48 years had, on average, a 0.18 lower cognitive function score (95% CI: (0.11 to 0.25) than the group classified as being internal (p<0.001). Participants who changed from external to internal over time, on average, had better cognitive function than those who remained external or changed to become external. In summary, an external LoC may be detrimental to cognitive function. Thus, interventions to increase internality may help to minimise the adverse consequences on cognitive health later in life.