Background HIV infection is known to cause developmental delay, but the effects of HIV exposure without infection during pregnancy on child development are unclear. We compared the neurodevelopmental outcomes of HIV-exposed uninfected and HIV-unexposed children during their first 2 years of life. Methods Pregnant women (>18 years of age) at 20-28 weeks' gestation were enrolled into the Drakenstein Child Health cohort study while attending routine antenatal appointments at one of two peri-urban community-based clinics in Paarl, South Africa. Livebirths born to enrolled women during follow-up were included in the birth cohort. Mothers and infants received antenatal and postnatal HIV testing and antiretroviral therapy per local guidelines. Developmental assessments on the Bayley Scales of Infant and Toddler Development, third edition (BSID-III), were done in a subgroup of infants at 6 months of age, and in the full cohort at 24 months of age, with assessors masked to HIV exposure status. Mean raw scores and the proportions of children categorised as having a delay (scores <-2 SDs from the reference mean) on BSID-III were compared between HIV-exposed uninfected and HIV-unexposed children. Findings 1225 women were enrolled between March 5, 2012, and March 31, 2015. Of 1143 livebirths, 1065 (93%) children were in follow-up at 6 months and 1000 (87%) at 24 months. Two children were diagnosed with HIV infection between birth and 24-month follow-up and were excluded from the analysis. BSID-III assessments were done in 260 (24%) randomly selected children (61 HIV-exposed uninfected, 199 HIV-unexposed) at 6 months and in 732 (73%) children (168 HIV-exposed uninfected, 564 HIV-unexposed) at 24 months. All HIV-exposed uninfected children were exposed to antiretrovirals (88% to maternal triple antiretroviral therapy). BSID-III outcomes did not significantly differ between HIV-exposed uninfected and HIV-unexposed children at 6 months. At 24 months, HIV-exposed uninfected children scored lower than HIV-unexposed for receptive language (adjusted mean difference-1•03 [95% CI-1•69 to-0•37]) and expressive language (-1•17 [-2•09 to-0•24]), whereas adjusted differences in cognitive (-0•45 [-1•32 to 0•43]), fine motor (0•09 [-0•49 to 0•66]), and gross motor (-0•41 [-1•09 to 0•27]) domain scores between groups were not significant. Correspondingly, the proportions of HIV-exposed uninfected children with developmental delay were higher than those of HIV-unexposed children for receptive language (adjusted odds ratio 1•96 [95% CI 1•09 to 3•52]) and expressive language (2•14 [1•11 to 4•15]). Interpretation Uninfected children exposed to maternal HIV infection and antiretroviral therapy have increased odds of receptive and expressive language delays at 2 years of age. Further long-term work is needed to understand developmental outcomes of HIV-exposed uninfected children, especially in regions such as sub-Saharan Africa that have a high prevalence of HIV exposure among children.