Multimorbidity, the presence of more than 1 long-term disorder, is associated with increased use of health services, but unplanned admissions to hospital may often be undesirable. Furthermore, socioeconomic deprivation and mental health comorbidity may lead to additional unplanned admissions. We examined the association between unplanned admission to hospital and physical multimorbidity, mental health and socioeconomic deprivation. We conducted a retrospective cohort study using data from 180 815 patients aged 20 years and older who were registered with 40 general practices in Scotland. Details of 32 physical and 8 mental health morbidities were extracted from the patients' electronic health records (as of Apr. 1, 2006) and linked to hospital admission data. We then recorded the occurrence of unplanned or potentially preventable unplanned acute (nonpsychiatric) admissions to hospital in the subsequent 12 months. We used logistic regression models, adjusting for age and sex, to determine associations between unplanned or potentially preventable unplanned admissions to hospital and physical multimorbidity, mental health and socioeconomic deprivation. We identified 10 828 (6.0%) patients who had at least 1 unplanned admission to hospital and 2037 (1.1%) patients who had at least 1 potentially preventable unplanned admission to hospital. Both unplanned and potentially preventable unplanned admissions were independently associated with increasing physical multimorbidity (for ≥4 v. 0 conditions, odds ratio [OR] 5.87 [95% confidence interval (CI) 5.45-6.32] for unplanned admissions, OR 14.38 [95% CI 11.87-17.43] for potentially preventable unplanned admissions), mental health conditions (for ≥1 v. 0 conditions, OR 2.01 [95% CI 1.92-2.09] for unplanned admissions, OR 1.80 [95% CI 1.64-1.97] for potentially preventable unplanned admissions) and socioeconomic deprivation (for most v. least deprived quintile, OR 1.56 [95% CI 1.43-1.70] for unplanned admissions, OR 1.98 [95% CI 1.63-2.41] for potentially preventable unplanned admissions). Physical multimorbidity was strongly associated with unplanned admission to hospital, including admissions that were potentially preventable. The risk of admission to hospital was exacerbated by the coexistence of mental health conditions and socioeconomic deprivation.