Background Patients with opioid dependency prescribed opioid agonist treatment (OAT) may also be prescribed sedative drugs. This may increase mortality risk but may also increase treatment duration, with overall benefit. We hypothesised that prescription of benzodiazepines in patients receiving OAT would increase risk of mortality overall, irrespective of any increased treatment duration. Methods and findings Data on 12,118 patients aged 15–64 years prescribed OAT between 1998 and 2014 were extracted from the Clinical Practice Research Datalink. Data from the Office for National Statistics on whether patients had died and, if so, their cause of death were available for 7,016 of these patients. We identified episodes of prescription of benzodiazepines, z-drugs, and gabapentinoids and used linear regression and Cox proportional hazards models to assess the associations of co-prescription (prescribed during OAT and up to 12 months post-treatment) and concurrent prescription (prescribed during OAT) with treatment duration and mortality. We examined all-cause mortality (ACM), drug-related poisoning (DRP) mortality, and mortality not attributable to DRP (non-DRP). Models included potential confounding factors. In 36,126 person-years of follow-up there were 657 deaths and 29,540 OAT episodes, of which 42% involved benzodiazepine co-prescription and 29% concurrent prescription (for z-drugs these respective proportions were 20% and 11%, and for gabapentinoids 8% and 5%). Concurrent prescription of benzodiazepines was associated with increased duration of methadone treatment (adjusted mean duration of treatment episode 466 days [95% CI 450 to 483] compared to 286 days [95% CI 275 to 297]). Benzodiazepine co-prescription was associated with increased risk of DRP (adjusted HR 2.96 [95% CI 1.97 to 4.43], p < 0.001), with evidence of a dose–response effect, but showed little evidence of an association with non-DRP (adjusted HR 0.91 [95% CI 0.66 to 1.25], p = 0.549). Co-prescription of z-drugs showed evidence of an association with increased risk of DRP (adjusted HR 2.75 [95% CI 1.57 to 4.83], p < 0.001) but little evidence of an association with non-DRP (adjusted HR 0.79 [95% CI 0.49 to 1.28], p = 0.342). There was no evidence of an association of gabapentinoid co-prescription with DRP (HR 1.54 [95% CI 0.60 to 3.98], p = 0.373) but evidence of an association with increased non-DRP (HR 1.83 [95% CI 1.28 to 2.62], p = 0.001). Concurrent benzodiazepine prescription also increased mortality risk after consideration of duration of OAT (adjusted HR for DRP with benzodiazepine concurrent prescription 3.34 [95% CI 2.14 to 5.20], p < 0.001). The main limitation of this study is the possibility that unmeasured confounding factors led to an association between benzodiazepine prescription and DRP that is not causal. Conclusions In this study, co-prescription of benzodiazepine was specifically associated with increased risk of DRP in opioid-dependent individuals. Co-prescription of z-drugs and gabapentinoids was also associated with increased mortality risk; however, for z-drugs there was no evidence for a dose–response effect on DRP, and for gabapentinoids the increased mortality risk was not specific to DRP. Concurrent prescription of benzodiazepine was associated with longer treatment but still increased risk of death overall. Clinicians should be cautious about prescribing benzodiazepines to opioid-dependent individuals.