Purpose: Reducing the use of coercion among patients with mental disorders has long been a political priority. However, risk factors for coercive measures have primarily been investigated in smaller studies. To reduce the use of coercion, it is crucial to identify people at risk which we aim to do in this first large-scale study. Methods: A cohort study was conducted among all psychiatric inpatients in Denmark, following 112,233 individuals during 1999–2014. Data from Danish registers were analysed using logistic regression for repeated measures. Results: 24,594 inpatients were exposed to a coercive measure (21.9%). Clinical characteristics were the foremost predictors of coercion and patients with organic mental disorder had the highest increased risk of being subjected to a coercive measure (OR = 5.56; 95% CI = 5.04, 6.14). The risk of coercion was the highest in the first admission and decreased with the number of admissions (all p < 0.001). The following socioeconomic variables were associated with an increased risk of coercion: male sex, unemployment, lower social class and immigrants from low and middle income countries (all p < 0.001). Early retirement and social relations, such as being married and having children, reduced the risk of being subjected to coercive measure (all p < 0.05). Conclusion: From our nationwide data, we identified a broad range of risk factors associated with coercive measures. Our findings can assist researchers in identifying patients at risk of coercion and thereby help targeting new coercion reduction programs.