Adult cognition and age-related cognitive decline can be influenced by dysregulation of the hypothalamic pituitary adrenal axis with concomitant changes in cortisol levels. However, very little is known about the role of childhood cognition and educational attainment in this relationship. Using data from the British 1946 birth cohort, the present study investigated: (1) associations between cortisol levels and patterns and cognitive function in midlife; (2) direct and interactive effects of childhood cognition, educational attainment and cortisol on cognitive function in midlife. Verbal memory, letter search speed and reaction time were assessed at age 60-64 years. Salivary cortisol samples (wakening, 30min after wakening and evening) were collected at the same age. Childhood cognitive ability was measured at ages 8, 11, and 15, and educational level was reported at age 26. Associations between cortisol, childhood cognition, educational attainment and cognitive function in midlife were tested using linear regression and structural equation modelling approaches. Higher evening cortisol level was associated with slower reaction time and lower verbal memory. These associations were independent of childhood cognition and education as well as a range of other potential confounders. Childhood cognition and education were not directly associated with evening cortisol. However, there was a significant interaction effect between childhood cognition and evening cortisol on reaction time (p=.002): higher evening cortisol was associated with slower reaction time only among those with low childhood cognitive ability. There was little evidence of associations between the other cortisol measures and cognitive function.