Release from prison is associated with a markedly increased risk of both fatal and non-fatal drug overdose, yet the risk factors for overdose in recently released prisoners are poorly understood. The aim of this study was to identify risk and protective factors for non-fatal overdose (NFOD) among a cohort of illicit drug users in Vancouver, Canada, according to recent incarceration. Methods: Prospective cohort of 2515 community-recruited illicit drug users in Vancouver, Canada, followed from 1996 to 2010. We examined factors associated with NFOD in the past six months separately among those who did and did not also report incarceration in the last six months. Results: One third of participants (n=829, 33.0 ) reported at least one recent NFOD. Among those recently incarcerated, risk factors independently and positively associated with NFOD included daily use of heroin, benzodiazepines, cocaine or methamphetamine, binge drug use, public injecting and previous NFOD. Older age, methadone maintenance treatment and HIV seropositivity were protective against NFOD. A similar set of risk factors was identified among those who had not been incarcerated recently. Conclusions: Among this cohort, and irrespective of recent incarceration, NFOD was associated with a range of modifiable risk factors including more frequent and riskier patterns of drug use. Not all ex-prisoners are at equal risk of overdose and there remains an urgent need to develop and implement evidence-based preventive interventions, targeting those with modifiable risk factors in this high risk group.