BACKGROUND: People who inject drugs (PWID) have a high incidence of HIV, little access to antiretroviral therapy (ART) and medication-assisted treatment (MAT), and high mortality. We aimed to assess the feasibility of a future controlled trial based on the incidence of HIV, enrolment, retention, and uptake of the intervention, and the efficacy of an integrated and flexible intervention on ART use, viral suppression, and MAT use. METHODS: This randomised, controlled vanguard study was run in Kyiv, Ukraine (one community site), Thai Nguyen, Vietnam (two district health centre sites), and Jakarta, Indonesia (one hospital site). PWID who were HIV infected (index participants) and non-infected injection partners were recruited as PWID network units and were eligible for screening if they were aged 18-45 years (updated to 18-60 years 8 months into study), and active injection drug users. Further eligibility criteria for index participants included a viral load of 1000 copies per mL or higher, willingness and ability to recruit at least one injection partner who would be willing to participate. Index participants were randomly assigned via a computer generated sequence accessed through a secure web portal (3:1) to standard of care or intervention, stratified by site. Masking of assignment was not possible due to the nature of intervention. The intervention comprised systems navigation, psychosocial counselling, and ART at any CD4 count. Local ART and MAT services were used. Participants were followed up for 12-24 months. The primary objective was to assess the feasibility of a future randomised controlled trial. To achieve this aim we looked at the following endpoints: HIV incidence among injection partners in the standard of care group, and enrolment and retention of HIV-infected PWID and their injection partners and the uptake of the integrated intervention. The study was also designed to assess the feasibility, barriers, and uptake of the integrated intervention. Endpoints were assessed in a modified intention-to-treat popualtion after exclusion of ineligible participants. This trial is registered on ClinicalTrials.gov, NCT02935296, and is active but not recruiting new participants. FINDINGS: Between Feb 5, 2015, and June 3, 2016, 3343 potential index participants were screened, of whom 502 (15%) were eligible and enrolled. 1171 injection partners were referred, and 806 (69%) were eligible and enrolled. Index participants were randomly assigned to intervention (126 [25%]) and standard of care (376 [75%]) groups. At week 52, most living index participants (389 [86%] of 451) and partners (567 [80%] of 710) were retained, and self-reported ART use was higher among index participants in the intervention group than those in the standard of care group (probability ratio [PR] 1·7, 95% CI 1·4-1·9). Viral suppression was also higher in the intervention group than in the standard of care group (PR 1·7, 95% CI 1·3-2·2). Index participants in the intervention group reported more MAT use at 52 weeks than those in the standard of care group (PR 1·7, 95% CI 1·3-2·2). Seven incident HIV infections occurred, and all in injection partners in the standard of care group (intervention incidence 0·0 per 100 person-years, 95% CI 0·0-1·7; standard of care incidence 1·0 per 100 person-years, 95% CI 0·4-2·1; incidence rate difference -1·0 per 100 person-years, 95% CI -2·1 to 1·1). No severe adverse events due to the intervention were recorded. INTERPRETATION: This vanguard study provides evidence that a flexible, scalable intervention increases ART and MAT use and reduces mortality among PWID. The low incidence of HIV in both groups impedes a future randomised, controlled trial, but given the strength of the effect of the intervention, its implementation among HIV-infected PWID should be considered. FUNDING: US National Institutes of Health.