To date, no data exist assessing the impact of either methadone or buprenorphine on adherence to highly active antiretroviral therapy (HAART) in the long term. This study was conducted in order to evaluate whether receiving take-home methadone and buprenorphine may ensure better adherence to HAART in individuals infected with human immunodeficiency virus (HIV) through injection drug use (IDU). Longitudinal data on adherence, opioid substitution treatment (OST) and patient behaviours starting from their first HAART prescription were collected for 276 individuals HIV-infected through drug use (n=1558 visits). Out-patient hospital services delivering HIV care in Marseilles, Avignon, Nice and Ile de France. At any given visit, patients were classified both according to the type of OST received and ongoing injection. Patients who reported no injection and no OST over the whole study period were considered as 'abstinent' and used as a reference category. A logit model based on generalized estimation equations (GEE) was used to identify predictors of non-adherence. After adjustment for alcohol consumption, depression and self-reported side effects, patients ceasing injection during OST and abstinent patients exhibited comparable adherence. Patients reporting injection, on OST or not, had a twofold and threefold risk, respectively, of non-adherence compared with abstinent patients (P<0.01 linear trend). Duration on OST without injecting was associated significantly with virological success. Both access to and effectiveness of OST contribute to sustaining adherence to HAART in HIV-infected IDUs. These results advocate strongly the need of wider use of OST in countries scaling-up HAART where HIV is driven by IDUs.