Our objectives were to determine whether procedural pain and glucose exposure are associated with altered structural and functional brain development differently in preterm males and females, and neurodevelopment at 18-month corrected age. Fifty-one very preterm neonates (22 males; median [interquartile range] gestational age 27.6 [2.0] weeks) underwent 3 serial scans including T1-weighted and resting-state functional magnetic resonance imaging (MRI) at median postmenstrual weeks: 29.4, 31.9, and 41.1. Thalamus, basal ganglia, and total brain volumes were segmented. Functional resting-state MRI data were extracted from the independent-components maps. Pain was operationalized as the total number of neonatal intensive care unit-administered invasive procedures. Neurodevelopmental outcomes at 18-month corrected age were assessed with the Bayley Scales of Infant Development, second edition. Generalized estimating equations assessed the association of pain and glucose exposure with brain structural and functional development. More invasive procedures were independently associated with slower growth of thalamic (P < 0.001), basal ganglia (P = 0.028), and total brain volumes (P = 0.001), particularly in females. Similar relationships were observed between glucose exposure and brain volumes. Functional connectivity between thalamus and sensorimotor cortices was negatively associated with number of invasive procedures. Greater procedural pain and higher glucose exposure were related to poorer neurodevelopmental outcomes. These findings suggest that structural and functional brain development is vulnerable to procedural pain. Glucose used for analgesia does not appear to mitigate the adverse impact of pain on brain development. The vulnerability of brain development in females towards early pain is distinct from other neonatal morbidities. The link between pain and glucose with neurodevelopment suggests that these factors have long-lasting impact.