Education has been found to have a positive influence on intelligence, but to be able to inform policy, it is important to analyse whether the observed association depends on the educational duration and intelligence prior to variations in educational attainment. Therefore, a longitudinal cohort study was conducted of all members of the Metropolit 1953 Danish Male Birth Cohort who were intelligence tested at age 12 and appeared before the Danish draft boards (N = 7389). A subpopulation also participated in the Copenhagen Aging and Midlife Biobank (N = 1901). The associations of educational attainment with intelligence in young adulthood and midlife were estimated by use of general linear regression with adjustment for intelligence test score at age 12 and family socioeconomic position. Results showed a positive association of educational attainment with intelligence test scores in both young adulthood and midlife after prior intelligence had been taken into account. The marginal cognitive benefits depended on the educational duration but did not reach a plateau until 17 years. Further, intelligence test score at age 12 was found to modify the association, suggesting that individuals with low intelligence in childhood derive the largest benefit from education. Comparing the strength of the association observed among participants and non-participants in our midlife study, we showed that selection due to loss to follow-up might bias the investigated association towards the null. This might explain previous studies' findings of relatively small cognitive benefits. In conclusion, education seems to constitute a promising method for raising intelligence, especially among the least advantaged individuals.