SummaryBackgroundCross-resistance after first-line antiretroviral therapy (ART) failure is expected to impair activity of nucleoside reverse-transcriptase inhibitors (NRTIs) in second-line therapy for patients with HIV, but evidence for the effect of cross-resistance on virological outcomes is limited. We aimed to assess the association between the activity, predicted by resistance testing, of the NRTIs used in second-line therapy and treatment outcomes for patients infected with HIV.MethodsWe did an observational analysis of additional data from a published open-label, randomised trial of second-line ART (EARNEST) in sub-Saharan Africa. 1277 adults or adolescents infected with HIV in whom first-line ART had failed (assessed by WHO criteria with virological confirmation) were randomly assigned to a boosted protease inhibitor (standardised to ritonavir-boosted lopinavir) with two to three NRTIs (clinician-selected, without resistance testing); or with raltegravir; or alone as protease inhibitor monotherapy (discontinued after week 96). We tested genotypic resistance on stored baseline samples in patients in the protease inhibitor and NRTI group and calculated the predicted activity of prescribed second-line NRTIs. We measured viral load in stored samples for all patients obtained every 12–16 weeks. This trial is registered with Controlled-Trials.com (number ISRCTN 37737787) and ClinicalTrials.gov (number NCT00988039).FindingsBaseline genotypes were available in 391 (92%) of 426 patients in the protease inhibitor and NRTI group. 176 (89%) of 198 patients prescribed a protease inhibitor with no predicted-active NRTIs had viral suppression (viral load <400 copies per mL) at week 144, compared with 312 (81%) of 383 patients in the protease inhibitor and raltegravir group at week 144 (p=0·02) and 233 (61%) of 280 patients in the protease inhibitor monotherapy group at week 96 (p<0·0001). Compared with results with no active NRTIs, 95 (85%) of 112 patients with one predicted-active NRTI had viral suppression (p=0·3) and 20 (77%) of 26 patients with two or three active NRTIs had viral suppression (p=0·08). Over all follow-up, greater predicted NRTI activity was associated with worse viral load suppression (global p=0·0004).InterpretationGenotypic resistance testing might not accurately predict NRTI activity in protease inhibitor-based second-line ART. Our results do not support the introduction of routine resistance testing in ART programmes in low-income settings for the purpose of selecting second-line NRTIs.FundingEuropean and Developing Countries Clinical Trials Partnership, UK Medical Research Council, Institito de Salud Carlos III, Irish Aid, Swedish International Development Cooperation Agency, Instituto Superiore di Sanita, WHO, Merck.