Children with HIV may experience adverse neurocognitive outcomes despite antiretroviral therapy (ART). Cytomegalovirus (CMV) is common in children with HIV. Among children on ART, we examined the influences of early HIV viral load (VL) and CMV DNA on neurocognition. We determined the association between pre-ART VL, cumulative VL, and CMV viremia and neurocognition using data from a cohort study. Children who initiated ART before 12 months of age were enrolled from 2007-2010 in Nairobi, Kenya. Blood was collected at enrollment and every 6 months thereafter. Four neurocognitive assessments with 12 domains were conducted when children were a median age of 7 years. Primary outcomes included cognitive ability, executive function, attention, and motor. Generalized linear models were used to determine associations between HIV VL (pre-ART and cumulative; N = 38) and peak CMV DNA (by 24 months of age; N = 20) and neurocognitive outcomes. In adjusted models, higher peak CMV viremia by 24 months of age was associated with lower cognitive ability and motor z-scores. Higher pre-ART HIV VL was associated with lower executive function z-scores. Among secondary outcomes, higher pre-ART VL was associated with lower mean nonverbal and metacognition z-scores. Higher pre-ART VL and CMV DNA in infancy were associated with lower executive function, nonverbal and metacognition scores and cognitive ability scores in childhood, respectively. These findings suggest long-term benefits of early HIV viral suppression and CMV control on neurocognition.