Objectives: To measure rates and predictors of virologic failure and switch to second-line antiretroviral therapy (ART) in South Africa. Design: Observational cohort study. Methods: We included ART-naive adult patients initiated on public sector ART (January 2000 to July 2008) at 5 sites in South Africa who completed ≥6 months of follow-up. We estimated cumulative risk of virologic failure (viral load ≥400 copies/mL with confirmation above varying thresholds) and switching to second-line ART. Results: Nineteen thousand six hundred forty-five patients (29,935 person-years) had a median of 1.3 years of study follow-up (1.8 years on ART) and a median CD4 count of 93 (IQR: 39-155) cells per microliter at ART initiation. About 9.9% (4.5 per 100 person-years) failed ART in median 16 (IQR: 12-23) months since ART initiation, with median 2.7 months (IQR: 1.6-4.7) months between first elevated and confirmatory viral loads. By survival analysis, using a confirmatory threshold of 400 copies per milliliter, 16.9% [95% confidence interval (CI): 15.4% to 18.6%] failed by 5 years on ART, but only 7.8% (95% CI: 6.6% to 9.3%) using a threshold of 10,000. CD4 <25 versus 100-199 (adjusted HR: 1.60; 95% CI: 1.37 to 1.87), ART initiation viral load ≥1,000,000 versus <10,000, (1.32; 0.91 to 1.93), and 2+ gaps in care versus 0 (95% CI: 7.25; 4.95 to 10.6) were predictive of failure. Overall, 10.1% (95% CI: 9.0% to 11.4%) switched to second-line by 5 years on ART. Lower CD4 at failure and higher rate of CD4 decline were predictive of switch (decline 100% to 51% versus 25% to -25%, adjusted HR: 1.96; 95% CI: 1.35 to 2.85).Conclusions: In resource-limited settings with viral load monitoring, virologic failure rates are highly sensitive to thresholds for confirmation. Despite clear guidelines there is considerable variability in switching failing patients, partially in response to immunologic status and postfailure evolution.