Necrotizing enterocolitis (NEC) increases the risk of brain injury and impaired neurodevelopment. Rapid brain maturation prior to birth may explain why preterm brains are particularly vulnerable to serious infections. Using pigs as models, we hypothesized that preterm birth was associated with altered blood-cerebrospinal fluid (CSF) barrier (BCSFB) function and cerebral structural deficits, and that NEC was associated with systemic inflammation, BCSFB disruption, and neuroinflammation. First, cesarean-delivered preterm and term pigs (n = 43–44) were euthanized at birth to investigate BCSFB function and markers of brain structural maturation, or on day 5 to measure markers of blood-brain barrier maturation in the hippocampus and striatum (experiment 1). Next, preterm pigs (n = 162) were fed increasing volumes of infant formula to assess NEC lesions, systemic inflammation, BCSFB permeability, cerebral histopathology, hippocampal microglial density, and cytokine levels on day 5 (experiments 2 and 3). In experiment 1, preterm newborns had increased CSF-plasma ratios of albumin and raffinose, reduced CSF glucose levels, as well as increased cerebral hydration and reduced white matter myelination compared with term animals. We observed lower hippocampal (but not striatal) perivascular astrocyte coverage for the first 5 days after preterm birth, accompanied by altered cell junction protein levels. In experiments 2 and– 3, piglets with severe NEC lesions showed reduced blood thrombocytes and increased plasma C-reactive protein and interleukin-6 levels. NEC was associated with increased CSF-plasma albumin and raffinose ratios, reduced CSF leukocyte numbers, and increased cerebral hydration. In the hippocampus, NEC was associated with pyramidal neuron loss and increased interleukin-6 levels. In the short term, NEC did not affect cerebral myelination or microglia density. In conclusion, altered BCSFB properties and brain structural deficits were observed in pigs after preterm birth. Acute gastrointestinal NEC lesions were associated with systemic inflammation, increased BCSFB permeability and region-specific neuronal damage. The results demonstrate the importance of early interventions against NEC to prevent brain injury in preterm infants.