Background: Two randomised, placebo-controlled trials-BENCHMRK-1 and BENCHMRK-2-investigated the efficacy and safety of raltegravir, an HIV-1 integrase strand-transfer inhibitor. We report final results of BENCHMRK-1 and BENCHMRK-2 combined at 3 years (the end of the double-blind phase) and 5 years (the end of the study). Methods: Integrase-inhibitor-naive patients with HIV resistant to three classes of drug and who were failing antiretroviral therapy were enrolled. Patients were randomly assigned (2:1) to raltegravir 400 mg twice daily or placebo, both with optimised background treatment. Patients and investigators were masked to treatment allocation until week 156, after which all patients were offered open-label raltegravir until week 240. The primary endpoint was previously assessed at 16 weeks. We assessed long-term efficacy with endpoints of the proportion of patients with an HIV viral load of less than 50 copies per mL and less than 400 copies per mL, and mean change in CD4 cell count, at weeks 156 and 240. Findings: 1012 patients were screened for inclusion. 462 were treated with raltegravir and 237 with placebo. At week 156, 51% in the raltegravir group versus 22% in the placebo group (non-completer classed as failure) had viral loads of less than 50 copies per mL, and 54% versus 23% had viral loads of less than 400 copies per mL. Mean CD4 cell count increase (analysed by an observed failure approach) was 164 cells per μL versus 63 cells per μL. After week 156, 251 patients (54%) from the raltegravir group and 47 (20%) from the placebo group entered the open-label raltergravir phase; 221 (47%) versus 44 (19%) completed the entire study. At week 240, viral load was less than 50 copies per mL in 193 (42%) of all patients initially assigned to raltegravir and less than 400 copies per mL in 210 (45%); mean CD4 cell count increased by 183 cells per μL. Virological failure occurred in 166 raltegravir recipients (36%) during the double-blind phase and in 17 of all patients (6%) during the open-label phase. The most common drug-related adverse events at 5 years in both groups were nausea, headache, and diarrhoea, and occurred in similar proportions in each group. Laboratory test results were similar in both treatment groups and showed little change after year 2. Interpretation: Raltegravir has a favourable long-term efficacy and safety profile in integrase-inhibitor-naive patients with triple-class resistant HIV in whom antiretroviral therapy is failing. Raltegravir is an alternative for treatment-experienced patients, particularly those with few treatment options. Funding: Merck Sharp & Dohme. © 2013 Elsevier Ltd.