Background: The effect of pretreatment HIV-1 drug resistance on the response to first-line combination antiretroviral therapy (ART) in sub-Saharan Africa has not been assessed. We studied pretreatment drug resistance and virological, immunological, and drug-resistance treatment outcomes in a large prospective cohort. Methods: HIV-1 infected patients in the PharmAccess African Studies to Evaluate Resistance Monitoring (PASER-M) cohort started non-nucleoside reverse transcriptase inhibitor-based ART at 13 clinical sites in six countries, from 2007 to 2009. We used the International Antiviral Society-USA drug resistance mutation list and the Stanford algorithm to classify participants into three pretreatment drug resistance categories: no pretreatment drug resistance, pretreatment drug resistance with fully active ART prescribed, or pretreatment drug resistance with reduced susceptibility to at least one prescribed drug. We assessed risk factors of virological failure (≥400 copies per mL) and acquired drug resistance after 12 months of ART by use of multilevel logistic regression with multiple imputations for missing data. CD4 cell count increase was estimated with linear mixed models. Findings: Pretreatment drug resistance results were available for 2579 (94%) of 2733 participants; 2404 (93%) had no pretreatment drug resistance, 123 (5%) had pretreatment drug resistance to at least one prescribed drug, and 52 (2%) had pretreatment drug resistance and received fully active ART. Compared with participants without pretreatment drug resistance, the odds ratio (OR) for virological failure (OR 2·13, 95% CI 1·44-3·14; p<0·0001) and acquired drug-resistance (2·30, 1·55-3·40; p<0·0001) was increased in participants with pretreatment drug resistance to at least one prescribed drug, but not in those with pretreatment drug resistance and fully active ART. CD4 count increased less in participants with pretreatment drug resistance than in those without (35 cells per μL difference after 12 months; 95% CI 13-58; p=0·002). Interpretation: At least three fully active antiretroviral drugs are needed to ensure an optimum response to first-line regimens and to prevent acquisition of drug resistance. Improved access to alternative combinations of antiretroviral drugs in sub-Saharan Africa is warranted. Funding: The Netherlands Ministry of Foreign Affairs.