ADVANCE compared the efficacy and safety of two antiretroviral first-line combinations (dolutegravir combined with emtricitabine and either tenofovir disoproxil fumarate or tenofovir alafenamide), with a third regimen (efavirenz combined with emtricitabine and tenofovir disoproxil fumarate) previously recommended by WHO. Here, we report the 96-week data for the study. This randomised, open-label, non-inferiority phase 3 trial, was done at two research sites in Johannesburg, South Africa, after participant recruitment from 11 public health clinics also in Johannesburg. Eligible participants were aged 12 years or older with HIV-1 infection, who weighed at least 40 kg, had no antiretroviral exposure in the previous 6 months, with a creatinine clearance of more than 60 mL/min (>80 mL per min in individuals aged <19 years), and a plasma HIV-1 RNA concentration of 500 copies per mL or higher. Individuals who were pregnant or had tuberculosis were excluded. Participants were randomly assigned (1:1:1) by study staff using a computerised randomisation system. Randomisation was stratified by age (12 and <19 years and ≥19 years). Participants were randomly assigned to once-daily oral fixed-dose combination tenofovir alafenamide 25 mg and emtricitabine 200 mg, and once-daily oral dolutegravir 50 mg; once-daily oral fixed-dose combination tenofovir disoproxil fumarate 300 mg and emtricitabine 200 mg, and once-daily oral dolutegravir 50 mg; or once-daily oral fixed-dose combination of tenofovir disoproxil fumarate 300 mg, emtricitabine 200 mg, and efavirenz 600 mg. The primary efficacy endpoint was the proportion of participants who had a plasma HIV-1 RNA concentration of less than 50 copies per mL at week 48, which has been reported previously. Here, we report the key secondary efficacy endpoint of the proportion of participants who had a plasma HIV-1 RNA concentration of less than 50 copies per mL at the week 96 visit, assessed in all participants who received at least one dose of any study drug, with a prespecified non-inferiority margin of -10%. Safety data, including clinical, dual-energy X-ray absorptiometry and laboratory data, are also reported. This study was registered with ClinicalTrials.gov, NCT03122262. Between Jan 17, 2017, and May 14, 2018, we screened 1453 individuals, of whom 1053 were enrolled: 351 participants were randomly assigned to the tenofovir alafenamide, emtricitabine, and dolutegravir group, 351 to the tenofovir disoproxil fumarate, emtricitabine, and dolutegravir group, and 351 to the tenofovir disoproxil fumarate, emtricitabine, and efavirenz group. All participants received at least one dose of study medication and were included in the primary analysis. At week 96, 276 (79%) of 351 participants in the tenofovir alafenamide, emtricitabine, and dolutegravir group, 275 (78%) of 351 participants in the tenofovir disoproxil fumarate, emtricitabine, and dolutegravir group, and 258 (74%) of 351 participants in the tenofovir disoproxil fumarate, emtricitabine, and efavirenz group had achieved a plasma HIV-1 RNA concentration of less than 50 copies per mL. Non-inferiority was established in all three comparisons. The proportion of patients with protocol-defined virological failure at week 96 was low in all treatment groups. Participants in the tenofovir alafenamide, emtricitabine, and dolutegravir group had fewer changes in bone density than the two other treatment groups. Mean weight gain was substantial (7·1 kg [SD 7·4] in the tenofovir alafenamide, emtricitabine, and dolutegravir group; 4·3 kg [6·7] in the tenofovir disoproxil fumarate, emtricitabine, and dolutegravir group, and 2·3 kg [7·0] in the tenofovir disoproxil fumarate, emtricitabine, and efavirenz group), and was greater among women than men. Ten (3%) of 351 participants in the tenofovir disoproxil fumarate, emtricitabine, and efavirenz group discontinued due to treatment-related adverse events, of which liver dysfunction (n=4) and rash (n=4) were most common. Medium-term and long-term metabolic and clinical consequences of the considerable increase in bodyweight observed in participants given these antiretroviral regimens and the trajectory of this weight gain over time, especially among women, require further study. USAID, Unitaid, South African Medical Research Council, ViiV Healthcare.