In general population samples, better childhood cognitive functioning is associated with decreased risk of depression in adulthood. However, this link has not been examined in extremely low birth weight survivors (ELBW, <1000 g), a group known to have poorer cognition and greater depression risk. This study assessed associations between cognition at age 8 and lifetime risk of major depressive disorder in 84 ELBW survivors and 90 normal birth weight (NBW, ⩾2500 g) individuals up to 29–36 years of age. The Wechsler Intelligence Scale for Children, Revised (WISC-R), Raven’s Coloured Progressive Matrices and the Token Test assessed general, fluid, and verbal intelligence, respectively, at 8 years of age. Lifetime major depressive disorder was assessed using the Mini International Neuropsychiatric Interview at age 29–36 years. Associations were examined using logistic regression adjusted for childhood socioeconomic status, educational attainment, age, sex, and marital status. Neither overall intelligence quotient (IQ) [WISC-R Full-Scale IQ, odds ratios (OR)=0.87, 95% confidence interval (CI)=0.43–1.77], fluid intelligence (WISC-R Performance IQ, OR=0.98, 95% CI=0.48–2.00), nor verbal intelligence (WISC-R Verbal IQ, OR=0.81, 95% CI=0.40–1.63) predicted lifetime major depression in ELBW survivors. However, every standard deviation increase in WISC-R Full-Scale IQ (OR=0.43, 95% CI=0.20–0.92) and Performance IQ (OR=0.46, 95% CI=0.21–0.97), and each one point increase on the Token Test (OR=0.80, 95% CI=0.67–0.94) at age 8 was associated with a reduced risk of lifetime depression in NBW participants. Higher childhood IQ, better fluid intelligence, and greater verbal comprehension in childhood predicted reduced depression risk in NBW adults. Our findings suggest that ELBW survivors may be less protected by superior cognition than NBW individuals.