Background. Aligning with the World Health Organization, South Africa has replaced ritonavir-boosted lopinavir (LPV/r) with dolutegravir (DTG) in second-line antiretroviral therapy (ART) after treatment failure with tenofovir disoproxil fumarate (TDF)/lamivudine or emtricitabine (XTC)/efavirenz (EFV). Initial guidance included special considerations for DTG use among women. Methods. We analyzed routine deidentified data of adults switched from TDF/XTC/EFV to second-line AZT/XTC/LPV/r, AZT/XTC/DTG, or TDF/XTC/DTG between December 2019 and December 2023 at 108 healthcare facilities in KwaZulu-Natal, South Africa. Among people switched before July 2021, we emulated a target trial comparing 24-month death or loss to followup (LTFU), and viremia (>50 copies/mL). We conducted intention-to-treat and per-protocol analyses using weighted logistic regression with bootstrapped CIs. Results. Overall, women were less likely than men to switch to DTG (RR: 0.92 [95% CI: .88, .96]; N = 3649). Of 2321 people switched before July 2021, 915 (39%) switched to AZT/XTC/LPV/r, 415 (18%) to zidovudine (AZT)/XTC/DTG, and 991 (43%) to TDF/XTC/DTG. Median age was 36 years (IQR: 30, 43) and 1364 (59%) were women. In intention-to-treat analyses, the standardized 24-month risk of death or LTFU was similar with AZT/XTC/LPV/r (31%), AZT/XTC/DTG (30%), and TDF/XTC/ DTG (34%). The standardized risk of 24-month viremia among those retained in care with a viral load result (N = 1270) was higher with AZT/XTC/LPV/r (50%) than with AZT/XTC/DTG (40%; aRD: −10% [95% CI −19%, −2%]) or TDF/XTC/DTG (39%; aRD: −11% [95% CI −18%, −5%]). Per-protocol analyses gave similar results. Conclusions. While retention was similar across regimens, viremia was less common on DTG-based ART, supporting current guidelines.