BackgroundThis study investigates opiate use in mediating the impact of history of incarceration on emergency department (ED) use.MethodData were collected from 1,341 clients who underwent HIV and STI screening in an outpatient care center in Long Beach, California. The Risk Behavior Assessment (RBA, baseline) and Risk Behavior Follow-Up Assessment (RBFA, follow-up) were administered to each client with at least a three months interval between assessments.ResultsOf 1341 participants in the study, 931 (69.43%) reported previous incarceration. Having a history of incarceration was significantly associated with emergency room use as well as a history of sexually transmitted infections (STIs), injection drug use, opiate use, and survival sex trading, defined as sex for money or drugs. The relationship between previous incarceration and ED use was mediated by opiate use for men but not for women. The findings suggested that the effect of history of incarceration on ED use was exacerbated when the individuals were male and opiate users.ConclusionsTargeted interventions in treatment and rehabilitation programs could help prevent unnecessary ED use and reduce the use of EDs through drug treatment during incarceration and after release.Electronic supplementary materialThe online version of this article (doi:10.1186/2194-7899-2-5) contains supplementary material, which is available to authorized users.