Background: Doravirine is a novel, non-nucleoside reverse transcriptase inhibitor that has shown non-inferior efficacy to ritonavir-boosted darunavir, with a superior lipid profile, in adults with HIV who were treatment naive at week 48 in the phase 3 DRIVE-FORWARD trial. Here we present the 96-week data for the study. Methods: This randomised, controlled, double-blind, multicentre, non-inferiority, phase 3 study was undertaken at 125 clinical centres in 15 countries. Eligible participants were adults (aged ≥18 years) infected with HIV-1 who were naive to antiretroviral therapy, with a plasma HIV-1 RNA concentration of 1000 copies per mL or higher at screening, and no known resistance to any of the study drugs. Participants were randomly assigned (1:1) using an interactive voice and web response system, stratified by baseline HIV-1 RNA concentration and background nucleoside reverse transcriptase inhibitor therapy, to doravirine (100 mg per day) or ritonavir-boosted darunavir (100 mg ritonavir and 800 mg darunavir per day), both with investigator-selected nucleoside reverse transcriptase inhibitors: emtricitabine and tenofovir disoproxil fumarate or abacavir and lamivudine. Participants and investigators were masked to treatment assignment until week 96. 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 achieved this concentration by week 96, assessed in all participants who received at least one dose of any study drug, regardless of whether it was their randomly assigned treatment. We used a US Food and Drug Administration snapshot approach and a margin of 10 percentage points to define the non-inferiority of doravirine to ritonavir-boosted darunavir at 96 weeks. Key safety endpoints were change in fasting serum lipid concentrations, the incidence of adverse events, and time to discontinuation due to an adverse event, assessed in all participants who received at least one dose of any study medication. This study is registered with ClinicalTrials.gov, NCT02275780, and is closed to accrual. Findings: Between Dec 1, 2014, and Oct 20, 2015, 1027 individuals were screened, of whom 769 participants were randomly assigned to doravirine (n=385) or ritonavir-boosted darunavir (n=384), and 383 in both groups were given at least one dose of their allocated treatment. Most participants were male (645 [84%] of 766) and white (560 [73%]), with a mean age of 35·2 years (SD 10·6). 292 participants in the doravirine group and 273 in the darunavir group completed 96 weeks of treatment. At week 96, a higher proportion of the doravirine group (277 [73%] of 383) achieved an HIV-1 RNA concentration of less than 50 copies per mL than did of the darunavir group (248 [66%] of 383; difference 7·1%, 95% CI 0·5–13·7). Responses were similar regardless of baseline characteristics. Treatment-emergent resistance to any study drug occurred in two (1%) of 383 participants in the doravirine group and one (<1%) of 383 in the ritonavir-boosted darunavir group. Significant differences were seen between treatment groups in mean changes from baseline in LDL cholesterol (−14·6 mg/dL, 95% CI −18·2 to −11·0) and non-HDL cholesterol (−18·4 mg/dL, −22·5 to −14·3). Frequencies of adverse events were similar between groups. No significant treatment difference (log-rank nominal p=0·063) through week 96 was observed in time to discontinuation due to an adverse event. The most common adverse events (week 0–96) were diarrhoea (65 [17%] in the doravirine group vs 91 [24%] in the ritonavir-boosted darunavir group), nausea (45 [12%] vs 52 [14%]), headache (57 [15%] vs 46 [12%]), and upper respiratory tract infection (51 [13%] vs 30 [8%]). Two participants, one in each group, died during treatment; neither death was considered to be related to study medication. Interpretation: These results through 96 weeks support the efficacy and safety results reported previously for doravirine at 48 weeks, supporting the use of doravirine for the long-term treatment of adults with previously untreated HIV-1 infection. Funding: Merck.