Preterm birth is linked to intellectual disability and there is evidence to suggest post-term birth may also incur risk. However, these associations have not yet been investigated in the absence of common genetic causes of intellectual disability, where risk associated with late delivery may be preventable. We therefore aimed to examine risk of intellectual disability without a common genetic cause across the entire range of gestation, using a matched-sibling design to account for unmeasured confounding by shared familial factors. We conducted a population-based retrospective study using data from the Stockholm Youth Cohort (n = 499,621) and examined associations in a nested cohort of matched outcome-discordant siblings (n = 8034). Risk of intellectual disability was greatest among those born extremely early (adjusted OR24 weeks = 14.54 [95% CI 11.46–18.44]), lessening with advancing gestational age toward term (aOR32 weeks = 3.59 [3.22–4.01]; aOR37
weeks = 1.50 [1.38–1.63]); aOR38 weeks = 1.26 [1.16–1.37]; aOR39 weeks = 1.10 [1.04–1.17]) and increasing with advancing gestational age post-term (aOR42 weeks = 1.16 [1.08–1.25]; aOR43 weeks = 1.41 [1.21–1.64]; aOR44 weeks = 1.71 [1.34–2.18]; aOR45 weeks = 2.07 [1.47–2.92]). Associations persisted in a cohort of matched siblings suggesting they were robust against confounding by shared familial traits. Risk of intellectual disability was greatest among children showing evidence of fetal growth restriction, especially when birth occurred before or after term. Birth at non-optimal gestational duration may be linked causally with greater risk of intellectual disability. The mechanisms underlying these associations need to be elucidated as they are relevant to clinical practice concerning elective delivery around term and mitigation of risk in post-term children.Electronic supplementary materialThe online version of this article (10.1007/s10654-017-0340-1) contains supplementary material, which is available to authorized users.