AIMS:To compare long-term criminal justice outcomes among opioid-dependent individuals randomized to receive buprenorphine or methadone. DESIGN, SETTING AND PARTICIPANTS:A 5-year follow-up was conducted in 2011-14 of 303 opioid-dependent participants entering three opioid treatment programs in California, USA in 2006-09 and randomized to receive either buprenorphine/naloxone or methadone. INTERVENTION AND COMPARATOR:Participants received buprenorphine/naloxone (BUP; n = 179) or methadone (MET; n = 124) for 24 weeks and then were tapered off their treatment over ≤ 8 weeks or referred for ongoing clinical treatment. Midway through the study, the randomization scheme was switched from 1 : 1 BUP : MET to 2 : 1 because of higher dropout in the BUP arm. MEASUREMENTS:Study outcomes included arrests and self-reported incarceration. Predictors included randomization condition (buprenorphine versus methadone), age, gender, race/ethnicity, use of cocaine, drug injection in the 30 days prior to baseline and study site. Treatment status (buprenorphine, methadone, none) during follow-up was included as a time-varying covariate. FINDINGS:There was no significant difference by randomization condition in the proportion arrested (buprenorphine: 55.3%, methadone: 54.0%) or incarcerated (40.9%, 47.3%) during follow-up. Among methadone-randomized individuals, arrest was less likely with methadone treatment (0.50, 0.35-0.72) during follow-up (relative to no treatment) and switching to buprenorphine had a lower likelihood of arrest than those receiving no treatment (0.39, 0.18-0.87). Among buprenorphine-randomized individuals, arrest was less likely with receipt of buprenorphine (0.49, 0.33-0.75) during follow-up and switching to methadone had a similar likelihood of arrest as methadone-randomized individuals receiving no treatment. Likelihood of arrest was also negatively associated with older age (0.98, 0.96-1.00); it was positively associated with Hispanic ethnicity (1.63, 1.04-2.56), cocaine use (2.00, 1.33-3.03), injection drug use (2.19, 1.26-3.83), and study site. CONCLUSIONS:In a US sample of people treated for opioid use disorder, continued treatment with either buprenorphine or methadone was associated with a reduction in arrests relative to no treatment. Cocaine use, injection drug use, Hispanic ethnicity and younger age were associated with higher likelihood of arrest.