Globally, over 16 million children were exposed to HIV during pregnancy but remain HIV-free at birth and throughout childhood by 2022. Children born HIV-free (CBHF) have higher morbidity and mortality and poorer neurodevelopment in early life compared to children who are HIV-unexposed (CHU), but long-term outcomes remain uncertain. We characterised school-age growth, cognitive and physical function in CBHF and CHU previously enrolled in the Sanitation Hygiene Infant Nutrition Efficacy (SHINE) trial in rural Zimbabwe. The SHINE trial enrolled pregnant women between 2012 and 2015 across 2 rural Zimbabwean districts. Co-primary outcomes were height-for-age Z-score and haemoglobin at age 18 months (clinicaltrials.gov NCT01824940). Children were re-enrolled if they were aged 7 years, resident in Shurugwi district, and had known pregnancy HIV-exposure status. From 5,280 pregnant women originally enrolled, 376 CBHF and 2016 CHU reached the trial endpoint at 18 months in Shurugwi; of these, 264 CBHF and 990 CHU were evaluated at age 7 years using the School-Age Health, Activity, Resilience, Anthropometry and Neurocognitive (SAHARAN) toolbox. Cognitive function was evaluated using the Kaufman Assessment Battery for Children (KABC-II), with additional tools measuring executive function, literacy, numeracy, fine motor skills, and socioemotional function. Physical function was assessed using standing broad jump and handgrip for strength, and the shuttle-run test for cardiovascular fitness. Growth was assessed by anthropometry. Body composition was assessed by bioimpedance analysis and skinfold thicknesses. A caregiver questionnaire measured demographics, socioeconomic status, nurturing, child discipline, food, and water insecurity. We prespecified the primary comparisons and used generalised estimating equations with an exchangeable working correlation structure to account for clustering. Adjusted models used covariates from the trial (study arm, study nurse, exact child age, sex, calendar month measured, and ambient temperature). They also included covariates derived from directed acyclic graphs, with separate models adjusted for contemporary variables (socioeconomic status, household food insecurity, religion, social support, gender norms, caregiver depression, age, caregiver education, adversity score, and number of children's books) and early-life variables (length-for-age-Z-score) at 18 months, birthweight, maternal baseline depression, household diet, maternal schooling and haemoglobin, socioeconomic status, facility birth, and gender norms. We applied a Bonferroni correction for the 27 comparisons (0.05/27) with threshold of p < 0.00185 as significant. We found strong evidence that cognitive function was lower in CBHF compared to CHU across multiple domains. The KABC-II mental processing index was 45.2 (standard deviation (SD) 10.5) in CBHF and 48.3 (11.3) in CHU (mean difference 3.3 points [95% confidence interval (95% CI) 2.0, 4.5]; p < 0.001). The school achievement test score was 39.0 (SD 26.0) in CBHF and 45.7 (27.8) in CHU (mean difference 7.3 points [95% CI 3.6, 10.9]; p < 0.001); differences remained significant in adjusted analyses. Executive function was reduced but not significantly in adjusted analyses. We found no consistent evidence of differences in growth or physical function outcomes. The main limitation of our study was the restriction to one of two previous study districts, with possible survivor and selection bias. In this study, we found that CBHF had reductions in cognitive function compared to CHU at 7 years of age across multiple domains. Further research is needed to define the biological and psychosocial mechanisms underlying these differences to inform future interventions that help CBHF thrive across the life-course. ClinicalTrials.gov The SHINE follow-up study was registered with the Pan-African Clinical Trials Registry (PACTR202201828512110). The original SHINE trial was registered at NCT https://clinicaltrials.gov/study/NCT01824940.