SummaryBackgroundCurrent approaches to stratify patients with psychiatric disorders into groups on the basis of violence risk are limited by inconsistency, variable accuracy, and unscalability. To address the need for a scalable and valid tool to assess violence risk in patients with schizophrenia spectrum or bipolar disorder, we describe the derivation of a score based on routinely collected factors and present findings from external validation.MethodsOn the basis of a national cohort of 75 158 Swedish individuals aged 15–65 years with a diagnosis of severe mental illness (schizophrenia spectrum or bipolar disorder) with 574 018 patient episodes between Jan 1, 2001, and Dec 31, 2008, we developed predictive models for violent offending (primary outcome) within 1 year of hospital discharge for inpatients or clinical contact with psychiatric services for outpatients (patient episode) through linkage of population-based registers. We developed a derivation model to determine the relative influence of prespecified criminal history and sociodemographic and clinical risk factors, which are mostly routinely collected, and then tested it in an external validation. We measured discrimination and calibration for prediction of violent offending at 1 year using specified risk cutoffs.FindingsOf the cohort of 75 158 patients with schizophrenia spectrum or bipolar disorder, we assigned 58 771 (78%) to the derivation sample and 16 387 (22%) to the validation sample. In the derivation sample, 830 (1%) individuals committed a violent offence within 12 months of their patient episode. We developed a 16-item model. The strongest predictors of violent offending within 12 months were conviction for previous violent crime (adjusted odds ratio 5·03 [95% CI 4·23–5·98]; p<0·0001), male sex (2·32 [1·91–2·81]; p<0·0001), and age (0·63 per 10 years of age [0·58–0·67]; p<0·0001). In external validation, the model showed good measures of discrimination (c-index 0·89 [0·85–0·93]) and calibration. For risk of violent offending at 1 year, with a 5% cutoff, sensitivity was 62% (95% CI 55–68) and specificity was 94% (93–94). The positive predictive value was 11% and the negative predictive value was more than 99%. We used the model to generate a simple web-based risk calculator (Oxford Mental Illness and Violence tool [OxMIV]).InterpretationWe have developed a prediction score in a national cohort of patients with schizophrenia spectrum or bipolar disorder, which can be used as an adjunct to decision making in clinical practice by identifying those who are at low risk of violent offending. The low positive predictive value suggests that further clinical assessment in individuals at high risk of violent offending is required to establish who might benefit from additional risk management. Further validation in other countries is needed.FundingWellcome Trust and Swedish Research Council.