Objectives: The aim of this study was to investigate the association between detention experience and hepatitis C virus (HCV) status, the role of duration and frequency of detention, and whether risk behaviours practiced in detention could explain an observed increase in risk. Methods: Current drug injectors (injecting in the last 12 months) were recruited to participate in a serobehavioural, cross-sectional survey using respondent-driven sampling in eight German cities during the years 2011-2014. Using multivariable logistic regression, the association between HCV status and reported detention experience was investigated. Results: A total of 1998 participants were included in the analysis. Of these, 19.9% reported no detention experience, 28.6% short and rare experience (3.5 years in total, 3 times), 12.1% short but frequent experience, 7.1% long but rare experience, and 32.4% long and frequent experience. After correcting for HCV risk factors, the association between detention experience and HCV status remained statistically significant. By adjusting the model for intramural risk behaviours, the odds ratios of detention experience were reduced but remained significant. Conclusions: The proportion of people who inject drugs positive for HCV increased with both frequency and duration of their detention experience. As intramural risk behaviours could not fully explain this increase, it appears that transfers between community and custody may confer additional risks.