Background and aimsHIV-infected people with substance use disorders are least likely to benefit from advances in HIV treatment. Integration of extended-release naltrexone (XR-NTX) into HIV clinics may increase engagement in the HIV care continuum by decreasing substance use. We aimed to compare (1) XR-NTX treatment initiation, (2) retention and (3) safety of XR-NTX versus treatment as usual (TAU) for treating opioid use disorder (OUD) and/or alcohol use disorder (AUD) in HIV clinics. DesignNon-blinded randomized trial of XR-NTX versus pharmacotherapy TAU. SettingHIV primary care clinics in Vancouver, BC, Canada and Chicago, IL, USA. ParticipantsFifty-one HIV-infected patients seeking treatment for OUD (n=16), AUD (n=27) or both OUD and AUD (n=8). MeasurementsPrimary outcomes were XR-NTX initiation (receipt of first injection within 4weeks of randomization) and retention at 16weeks. Secondary outcomes generated point estimates for change in substance use, HIV viral suppression [HIV RNA polymerase chain reaction (pcr)<200 copies/ml] and safety. FindingsTwo-thirds (68%) of participants assigned to XR-NTX initiated treatment, and 88% of these were retained on XR-NTX at 16weeks. In comparison, 96% of TAU participants initiated treatment, but only 50% were retained on medication at 16weeks. Mean days of opioid use in past 30 days decreased from 17.3 to 4.1 for TAU and from 20.3 to 7.7 for XR-NTX. Mean heavy drinking days decreased from 15.6 to 5.7 for TAU and 12.5 to 2.8 for XR-NTX. Among those with OUD, HIV suppression improved from 67 to 80% for XR-NTX and 58 to 75% for TAU. XR-NTX was well tolerated, with no precipitated withdrawals and one serious injection-site reaction. ConclusionsExtended-release naltrexone (XR-NTX) is feasible and safe for treatment of opioid use disorder and alcohol use disorder in HIV clinics. Treatment initiation appears to be lower and retention greater for XR-NTX compared with treatment as usual ( NCT01908062).