ABSTRACT: BACKGROUND:Self-harm is a leading cause of morbidity in prisoners. Although a wide range of risk factors for self-harm in prisoners has been identified, the strength and consistency of effect sizes is uncertain. We aimed to synthesise evidence and assess the risk factors associated with self-harm inside prison. METHODS:In this systematic review and meta-analysis, we searched four electronic databases (PubMed, Embase, Web of Science, and PsycINFO) for observational studies on risk factors for self-harm in prisoners published from database inception to Oct 31, 2019, supplemented through correspondence with authors of studies. We included primary studies involving adults sampled from general prison populations who self-harmed in prison and a comparison group without self-harm in prison. We excluded studies with qualitative or ecological designs, those that reported on lifetime measures of self-harm or on selected samples of prisoners, and those with a comparison group that was not appropriate or not based on general prison populations. Data were extracted from the articles and requested from study authors. Our primary outcome was the risk of self-harm for risk factors in prisoners. We pooled effect sizes as odds ratios (OR) using random effects models for each risk factor examined in at least three distinct samples. We assessed study quality on the basis of the Newcastle-Ottawa Scale and examined between-study heterogeneity. The study protocol was registered with PROSPERO, CRD42018087915. FINDINGS:We identified 35 independent studies from 20 countries comprising a total of 663?735 prisoners, of whom 24?978 (3·8%) had self-harmed in prison. Across the 40 risk factors examined, the strongest associations with self-harm in prison were found for suicide-related antecedents, including current or recent suicidal ideation (OR 13·8, 95% CI 8·6-22·1; I2=49%), lifetime history of suicidal ideation (8·9, 6·1-13·0; I2=56%), and previous self-harm (6·6, 5·3-8·3; I2=55%). Any current psychiatric diagnosis was also strongly associated with self-harm (8·1, 7·0-9·4; I2=0%), particularly major depression (9·3, 2·9-29·5; I2=91%) and borderline personality disorder (9·2, 3·7-22·5; I2=81%). Prison-specific environmental risk factors for self-harm included solitary confinement (5·6, 2·7-11·6; I2=98%), disciplinary infractions (3·5, 1·2-9·7; I2=99%), and experiencing sexual or physical victimisation while in prison (3·2, 2·1-4·8; I2=44%). Sociodemographic (OR range 1·5-2·5) and criminological (1·8-2·3) factors were only modestly associated with self-harm in prison. We did not find clear evidence of publication bias. INTERPRETATION:The wide range of risk factors across clinical and custody-related domains underscores the need for a comprehensive, prison-wide approach towards preventing self-harm in prison. This approach should incorporate both population and targeted strategies, with multiagency collaboration between the services for mental health, social care, and criminal justice having a key role. FUNDING:Wellcome Trust.