Background: Hepatitis C virus (HCV) infection is common in persons who inject drugs (PWID). Objective: To evaluate elbasvir-grazoprevir in treating HCV infection in PWID. Design: Randomized, placebo-controlled, double-blind trial. (ClinicalTrials.gov: NCT02105688) Setting: Australia, Canada, France, Germany, Israel, the Netherlands, New Zealand, Norway, Spain, Taiwan, the United Kingdom, and the United States. Patients: 301 treatment-naive patients with chronic HCV genotype 1, 4, or 6 infection who were at least 80% adherent to visits for opioid agonist therapy (OAT). Intervention: The immediate-treatment group (ITG) received elbasvir-grazoprevir for 12 weeks; the deferred-treatment group (DTG) received placebo for 12 weeks, no treatment for 4 weeks, then open-label elbasvir-grazoprevir for 12 weeks. Measurements: The primary outcome was sustained virologic response at 12 weeks (SVR12), evaluated separately in the ITG and DTG. Other outcomes included SVR24, viral recurrence or reinfection, and adverse events. Results: The SVR12 was 91.5% (95% CI, 86.8% to 95.0%) in the ITG and 89.5% (95% CI, 81.5% to 94.8%) in the active phase of the DTG. Drug use at baseline and during treatment did not affect SVR12 or adherence to HCV therapy. Among 18 patients with posttreatment viral recurrence through 24-week follow-up, 6 had probable reinfection. If the probable reinfections were assumed to be responses, SVR12 was 94.0% (CI, 89.8% to 96.9%) in the ITG. One patient in the ITG (1 of 201) and 1 in the placebophase DTG (1 of 100) discontinued treatment because of an adverse event. Limitation: These findings may not be generalizable to PWID who are not receiving OAT, nor do they apply to persons with genotype 3 infection, a common strain in PWID. Conclusion: Patients with HCV infection who were receiving OAT and treated with elbasvir-grazoprevir had high rates of SVR12, regardless of ongoing drug use. These results support the removal of drug use as a barrier to interferon-free HCV treatment for patients receiving OAT.