Taiwan has experiencing an outbreak of HIV infection among injection drug users (IDUs) since 2003. A case-control study was conducted to determine the behavioral characteristics associated with HIV infection among IDUs. The study identified 120 inmates with HIV infection and 121 matched HIV-negative controls from prisons. Data were collected by face-to-face interviews. The study found 48.1% of IDUs shared needles, less than a half of IDUs reported sexual intercourse before incarceration and only 19.7% used condoms. The multivariate logistic regression analysis, adjusted for years of heroin injection, found that HIV infection was independently associated with the use of a used needle or syringe at the latest injection (odds ratio [OR], 8.2; 95% confidence interval [CI], 3.3-20.2, p<0.001), having HIV-infected relatives or friends (OR, 5.7; 95%CI, 2.5-13.2, p<0.001) and sharing containers with others (OR, 3.3; 95%CI, 1.2-8.8, p=0.02). Our findings highlight the importance of needle exchange programs along with HIV-prevention education.