OBJECTIVES: To evaluate long-term virological failure (VF) and drug resistance among HIV-infected Ugandan children on first-line ART. METHODS: In a multicentre prospective cohort study, viral load (VL) and drug resistance mutations (DRMs) were investigated at baseline and 6 monthly intervals in children (age ≤ 12 years). VF (two consecutive VLs >1000 copies/mL or death after 6 months of ART) was defined as early VF (0-24 months of ART) or late VF (25-48 months of ART). An active regimen was defined as partially active if the genotypic susceptibility score (GSS) was <3. RESULTS: Between 2010 and 2011, 316 children were enrolled. Viral suppression was achieved in 75.8%, 71.5%, 72.6% and 69.2% at 12, 24, 36 and 48 months. VF occurred in 111/286 (38.8%), of which 67.6% was early and 32.4% late VF. Early VF was associated with a partially active regimen at baseline (OR 6.0, 95% CI 1.9-18.5), poor adherence (OR 3.1, 95% CI 1.3-7.4) and immunodeficiency (OR 3.3, 95% CI 1.1-10.2). Late VF was associated with age >3 years (OR 2.5, 95% CI 1.0-6.6) and WHO stage 3/4 (OR 4.2, 95% CI 1.4-13.4). Acquired DRMs were detected in 27.0% before 24 months, versus 14.4% after 24 months (P < 0.001). A total of 92.2% of the children with early VF, versus 56.2% with late VF, had a partially active regimen (P < 0.001). CONCLUSIONS: VF rates were high, occurred predominantly in the first 24 months and appeared to increase again in year four. Risk factors and patterns of early VF/DRMs were different from those of late VF/DRMs. Virological control may improve by close monitoring and prompt switching to second-line therapy in the first 24 months. Late VF may be prevented by early start of ART.