This study was undertaken to describe factors associated with exposure to the hepatitis B virus (HBV) in treated injection drug users to better aim prevention and care in high risk subgroups. The naturalistic study was conducted in Munich, Germany, and 1,018 patients who ever shared needles admitted for opioid detoxification were included. Sociodemographic, drug and drug treatment related variables and the virological status (HCV, HIV) were included in the bivariate and multiple logistic regression analysis. Sera were tested positive for antibodies against HBc in 40.2%, against HCV in 60.9%, and against HIV in 4.7% of patients. Older age, living without partner, longer duration of IDU, positive drug treatment history, imprisonment, emergency treatment, daily alcohol consumption, type of opioid dependency, and being positive for anti-HCV or anti-HIV were significant individual factors associated with positive anti-HBc-serology. Using multiple logistic regression history of imprisonment and being positive for anti-HCV remained independently associated with positive anti-HBc-serology. HBV-infection in IDUs should alert for simultaneous HCV-infection. Contacts to the criminal justice system are to be used for HBV prevention programs, including vaccination when indicated. Prevention programs should be implemented early in or even before the begin of a drug career.