Little is known about the impact of pretreatment drug resistance (PDR) on the efficacy of second generation integrase inhibitors. We sequenced pretreatment plasma specimens from the ADVANCE trial (NCT03122262). Our primary outcome was 96-week virologic success, defined as a sustained viral load <1000 copies/mL from 12 weeks onwards, <200 copies/mL from 24 weeks onwards, and <50 copies/mL after 48 weeks. Here we report how this outcome was impacted by PDR, defined by the World Health Organization (WHO) mutation list. Of 1053 trial participants, 874 (83%) have successful sequencing, including 289 (33%) randomized to EFV-based therapy and 585 (67%) randomized to DTG-based therapy. Fourteen percent (122/874) have ≥1 WHO-defined mutation, of which 98% (120/122) are NNRTI mutations. Rates of virologic suppression are lower in the total cohort among those with PDR 65% (73/112) compared to those without PDR (85% [605/713], P < 0.001), and for those on EFV-based treatment (60% [12/20] vs 86% [214/248], P = 0.002) and for those on DTG-based treatment (61/92 [66%] vs 84% [391/465] P < 0.001, P for interaction by regimen 0.49). Results are similar in multivariable models adjusted for clinical characteristics and adherence. NNRTI resistance prior to treatment is associated with long-term failure of integrase inhibitor-containing first-line regimens, and portends high rates of first-line failure in sub Saharan Africa.