OBJECTIVE: To develop an algorithm for optimal use of viral load testing in patients with suspected first-line antiretroviral treatment (ART) failure. METHODS: Data from a cohort of patients on first-line ART in Cambodia were analyzed in a cross-sectional way to detect markers for treatment failure. Markers with an adjusted likelihood ratio <0.67 or >1.5 were retained to calculate a predictor score. The accuracy of a 2-step algorithm based on this score followed by targeted viral load testing was compared with World Health Organization criteria for suspected treatment failure. RESULTS: One thousand eight hundred three viral load measurements of 764 patients were available for analysis. Prior ART exposure, CD4 count below baseline, 25% and 50% drop from peak CD4 count, hemoglobin drop of > or =1 g/dL, CD4 count <100 cells per microliter after 12 months of treatment, new onset of papular pruritic eruption, and visual analog scale <95% were included in the predictor score. A score >or=2 had the best combination of sensitivity and specificity and required confirmatory viral load testing for only 9% of patients. World Health Organization criteria had a similar sensitivity but a lower specificity and required viral load testing for 24.9% of patients. CONCLUSION: An algorithm combining a predictor score with targeted viral load testing in patients with an intermediate probability of failure optimizes the use of scarce resources.