SummaryBackgroundSelf-harm and suicide are common in prisoners, yet robust information on the full extent and characteristics of people at risk of self-harm is scant. Furthermore, understanding how frequently self-harm is followed by suicide, and in which prisoners this progression is most likely to happen, is important. We did a case-control study of all prisoners in England and Wales to ascertain the prevalence of self-harm in this population, associated risk factors, clustering effects, and risk of subsequent suicide after self-harm.MethodsRecords of self-harm incidents in all prisons in England and Wales were gathered routinely between January, 2004, and December, 2009. We did a case-control comparison of prisoners who self-harmed and those who did not between January, 2006, and December, 2009. We also used a Bayesian approach to look at clustering of people who self-harmed. Prisoners who self-harmed and subsequently died by suicide in prison were compared with other inmates who self-harmed.Findings139 195 self-harm incidents were recorded in 26 510 individual prisoners between 2004 and 2009; 5–6% of male prisoners and 20–24% of female inmates self-harmed every year. Self-harm rates were more than ten times higher in female prisoners than in male inmates. Repetition of self-harm was common, particularly in women and teenage girls, in whom a subgroup of 102 prisoners accounted for 17 307 episodes. In both sexes, self-harm was associated with younger age, white ethnic origin, prison type, and a life sentence or being unsentenced; in female inmates, committing a violent offence against an individual was also a factor. Substantial evidence was noted of clustering in time and location of prisoners who self-harmed (adjusted intra-class correlation 0·15, 95% CI 0·11–0·18). 109 subsequent suicides in prison were reported in individuals who self-harmed; the risk was higher in those who self-harmed than in the general prison population, and more than half the deaths occurred within a month of self-harm. Risk factors for suicide after self-harm in male prisoners were older age and a previous self-harm incident of high or moderate lethality; in female inmates, a history of more than five self-harm incidents within a year was associated with subsequent suicide.InterpretationThe burden of self-harm in prisoners is substantial, particularly in women. Self-harm in prison is associated with subsequent suicide in this setting. Prevention and treatment of self-harm in prisoners is an essential component of suicide prevention in prisons.FundingWellcome Trust, National Institute for Health Research, National Offender Management Service, and Department of Health.