Context. Fear of pain resonates with most people, in particular, in relation to dying. Despite this, there are still people dying with unrelieved pain.Objectives. We quantified the risk, and investigated risk factors, for dying with unrelieved pain in a nationwide observational cohort study.Methods. Using data from Swedish Register of Palliative Care, we analyzed 161,762 expected deaths during 2011e2015. The investigated risk factors included cause of death, place of death, absence of an end-of-life (EoL) conversation, and lack of contact with pain management expertise. Modified Poisson regression models were fitted to estimate risk ratios (RRs) and 95% confidence intervals (CIs) for dying with unrelieved pain.Results. Unrelieved pain during the final week of life was reported for 25% of the patients with pain, despite prescription of opioids PRN in 97% of cases. Unrelieved pain was common both among patients dying of cancer and of nonmalignant chronic diseases. Statistically significant risk factors for unrelieved pain included hospital death (RR ¼ 1.84, 95% CI 1.79e1.88) compared with dying in specialist palliative care, absence of an EoL conversation (RR ¼ 1.42, 95% CI 1.38e1.45), and dying of cancer in the bones (RR ¼ 1.13, 95% CI 1.08e1.18) or lung (RR ¼ 1.10, 95% CI 1.06e1.13) compared with nonmalignant causes.Conclusion. Despite almost complete prescription of opioids PRN for patients with pain, patients die with unrelieved pain. Health care providers, hospitals in particular, need to focus more on pain in dying patients. An EoL conversation is one achievable intervention. J Pain Symptom Manage 2019;58:784e791. Ó