OBJECTIVES: To examine if gestational age groups predict the development of social competence difficulties (SCDs) from childhood into mid-adolescence and to assess the mediation by maternal psychological distress during infancy on these trajectories. DESIGN: Nationally representative population-based birth cohort (UK Millennium Cohort Study). PARTICIPANTS: 15 821 children born in 2000-2002. OUTCOME MEASURES: SCDs (derived from peer and prosocial subscales of Strengths and Difficulties Questionnaire) were assessed by parent report when the participants were aged 3, 5, 7, 11 and 14 years. Maternal psychological distress was self-rated using Rutter Malaise Inventory when the children were 9 months of age. Data were modelled using latent growth curve analysis. RESULTS: Developmental trajectories of SCDs were U-shaped in all groups. Very preterm (VP) children (<32 weeks, n=173) showed pronounced difficulties throughout, with the coefficient difference from the full term at age 14 being 0.94 (95% CI 0.23 to 1.66, equivalent to 0.32 SD of the population average SCDs). Moderate-to-late preterm children (32-36 weeks, n=1130) and early-term children (37-38 weeks, n=3232) showed greater difficulties compared with the full-term peers around age 7 years, which resolved by age 14 years (b=0.20, 95% CI -0.05 to 0.44; b=0.03, 95% CI -0.12 to 0.17, respectively). Maternal psychological distress during infancy mediated 20% of the aforementioned association at age 14 years for the VP. CONCLUSION: There was a dose-response association between gestational age and the trajectories of SCDs. Monitoring and providing support on social development throughout childhood and adolescence and treating early maternal psychological distress may help children who were born earlier than ideal, particularly those born VP