The prevalence of HIV and associated risk behaviors were assessed among three groups of heroin users: long term injection drug users (LTIDUs), new injection drug users (NIDUs), and heroin sniffers (HSs) with no history of injection. HIV seroprevalence was similar among NIDUs (13.3%) and HSs (12.7%). LTIDUs had almost twice as high a level of HIV infection (24.7%). After including drug use and sex behavior variables in logistic regression models, both drug and sexual risk factors remained in the models. Attributable risk percent (APR) from injection for HIV infection among injection drug users was estimated to be 55.7% for LTIDUs and 5.8% for NIDUs. High-risk sex behavior plays an important role in the prevalence of HIV among drug users and accounts for nearly all the infection among NIDUs. Both injection and sexual risk behaviors need to be stressed in HIV prevention and intervention programs aimed at drug users.