Lower cognitive ability is a risk factor for some forms of severe psychiatric disorder, but it is unclear whether it influences risk of psychological distress due to anxiety or the milder forms of depression. The participants in the present study were members of two British birth national birth cohorts, the 1958 National Child Development Survey (n=6369) and the 1970 British Cohort Study (n=6074). We examined the association between general cognitive ability (intelligence) measured at age 10 (1970 cohort) and 11 years (1958 cohort) and high levels of psychological distress at age 30 (1970 cohort) or 33 years (1958 cohort), defined as a score of 7 or more on the Malaise Inventory. In both cohorts, participants with higher intelligence in childhood had a reduced risk of psychological distress. In sex-adjusted analyses, a standard deviation (15 points) increase in IQ score was associated with a 39% reduction in psychological distress in the 1958 cohort and a 23% reduction in the 1970 cohort [odds ratios (95% confidence intervals) were 0.61 (0.56, 0.68) and 0.77 (0.72, 0.83), respectively]. These associations were only slightly attenuated by further adjustment for potential confounding factors in childhood, including birth weight, parental social class, material circumstances, parental death, separation or divorce, and behaviour problems, and for potential mediating factors in adulthood, educational attainment and current social class. Intelligence in childhood is a risk factor for psychological distress due to anxiety and the milder forms of depression in young adults. Understanding the mechanisms underlying this association may help inform methods of prevention.