Infection and infection-related complications are important causes of death and morbidity following preterm birth. Despite this risk, there is limited understanding of the development of the immune system in those born prematurely, and of how this development is influenced by perinatal factors. Here we prospectively and longitudinally follow a cohort of babies born before 32 weeks of gestation. We demonstrate that preterm babies, including those born extremely prematurely (<28 weeks), are capable of rapidly acquiring some adult levels of immune functionality, in which immune maturation occurs independently of the developing heterogeneous microbiome. By contrast, we observe a reduced percentage of CXCL8-producing T cells, but comparable levels of TNF-producing T cells, from babies exposed to in utero or postnatal infection, which precedes an unstable post-natal clinical course. These data show that rapid immune development is possible in preterm babies, but distinct identifiable differences in functionality may predict subsequent infection mediated outcomes.