Few studies have investigated immune cell ontogeny throughout the period of increased vulnerability to infections in early life. Here, we evaluated the dynamics of two critical T cell populations, regulatory T (Treg) cells and Th17 cells, over the first 9 months of life. We observed that Treg and Th17 cells developed in a synchronous fashion. Infants exposed to HIV in utero (iHEU), who are more likely to develop infections, had a lower frequency of Tregs at birth and 36 weeks compared to HIV unexposed infants. This increased Th17/Treg ratio in iHEU was associated with impaired gut integrity at birth. These findings suggest that gut damage disrupts the Th17/Treg ratio during infant immune development, likely by attracting Treg cells to regulate inflammation occurring in the gut, so revealing an immune-gut nexus influenced by HIV exposure.