SummaryBackgroundEpilepsy is associated with high rates of premature mortality, but the contribution of psychiatric comorbidity is uncertain. We assessed the prevalence and risks of premature mortality from external causes such as suicide, accidents, and assaults in people with epilepsy with and without psychiatric comorbidity.MethodsWe studied all individuals born in Sweden between 1954 and 2009 with inpatient and outpatient diagnoses of epilepsy (n=69 995) for risks and causes of premature mortality. Patients were compared with age-matched and sex-matched general population controls (n=660 869) and unaffected siblings (n=81 396). Sensitivity analyses were done to investigate whether these odds differed by sex, age, seizure types, comorbid psychiatric diagnosis, and different time periods after epilepsy diagnosis.Results6155 (8.8%) people with epilepsy died during follow-up, at a median age of 34·5 (IQR 21·0–44·0) years with substantially elevated odds of premature mortality (adjusted odds ratio [aOR] of 11·1 [95% CI 10·6–11·6] compared with general population controls, and 11·4 [10·4–12·5] compared with unaffected siblings). Of those deaths, 15·8% (n=972) were from external causes, with high odds for non-vehicle accidents (aOR 5·5, 95 % CI 4·7–6·5) and suicide (3·7, 3·3–4·2). Of those who died from external causes, 75·2% had comorbid psychiatric disorders, with strong associations in individuals with co-occurring depression (13·0, 10·3–16·6) and substance misuse (22·4, 18·3–27·3), compared with patients with no epilepsy and no psychiatric comorbidity.InterpretationReducing premature mortality from external causes of death should be a priority in epilepsy management. Psychiatric comorbidity plays an important part in the premature mortality seen in epilepsy. The ability of health services and public health measures to prevent such deaths requires review.FundingWellcome Trust, the Swedish Prison and Probation Service, and the Swedish Research Council.