The duration of pregnancy is influenced by fetal and maternal genetic and non-genetic factors. We conducted a fetal genome-wide association meta-analysis of gestational duration, and early preterm, preterm, and postterm birth in 84,689 infants. One locus on chromosome 2q13 was associated with gestational duration; the association was replicated in 9,291 additional infants (combined P = 3.96 x 10-14). Analysis of 15,536 mother-child pairs showed that the association was driven by fetal rather than maternal genotype. Functional experiments showed that the lead SNP, rs7594852, alters the binding of the HIC1 transcriptional repressor. Genes at the locus include several interleukin 1 family members with roles in pro-inflammatory pathways that are central to the process of parturition. Further understanding of the underlying mechanisms will be of great public health importance, since giving birth either before or after the window of term gestation is associated with increased morbidity and mortality.