Background: Pretreatment HIV drug resistance (PDR) can impair virological response to ART, jeopardizing effective treatment for children. Methods: Children aged ≤12 years initiated first-line ART in Uganda during 2010-11. Baseline and 6 monthly viral load (VL) and genotypic resistance testing if VL > 1000 copies/mL was done. The 2015 IAS-USA mutation list and Stanford algorithm were used to score drug resistance mutations (DRMs) and susceptibility. Virological failure (VF) was defined as two consecutive VLs > 1000 copies/mL or death after 6months of ART. Factors associated with failure and acquired drug resistance (ADR) were assessed in a logistic regression analysis. Results: Among 317 children enrolled, median age was 4.9 years and 91.5% received NNRTI-based regimens. PDR was detected in 47/278 (16.9%) children, of whom 22 (7.9%) had resistance against their first-line regimen and were therefore on a partially active regimen. After 24months of follow-up, 92/287 (32.1%) had experienced VF. Children with PDR had a higher risk of VF (OR 15.25, P < 0.001) and ADR (OR 3.58, P=0.01). Conclusions: Almost one-third of children experienced VF within 24months of NNRTI-based first-line treatment. PDR was the strongest predictor of VF and ADR, and therefore presents a major threat in children. There is a need for ART regimens that maximize effectiveness of first-line therapy for long-term treatment success in the presence of PDR or incorporation of routine VL testing to detect VF and change treatment in time, in order to prevent clinical deterioration and accumulation of additional drug resistance. Children ≤3 years should be initiated on a PI-based regimen as per WHO guidelines.