Aims To evaluate the relationship between comorbidity and in-hospital mortality in elderly patients affected by dementia. Methods Data were obtained from the Italian Ministry of Health and included all discharge records from Italian hospitals concerning subjects aged ≥ 65 years admitted to acute Internal Medicine or Geriatrics wards between January 2015 and December 2016 (3.695.278 admissions). The variables analyzed included age, sex, and in-hospital death. Twenty-five homogeneous clusters of diseases were identified in discharge codes according to the ICD-9-CM classification. Results Patients with dementia represented 7.5% of the sample (n. 278.149); they were older, more often males (51.9%), and had a higher in-hospital mortality (24.3%) compared to patients without dementia (9.7%). Dementia per se doubled the odds of death (OR 1.98; 95% CI 1.95-2.00), independent of age, sex, and comorbidities. Seven clusters of disease (pneumonia, heart failure, kidneys disease, cancer, infectious diseases, diseases of fluids/electrolytes and general symptoms) were associated with increased in-hospital mortality, independent of the presence/absence of dementia. Among patients with dementia, heart failure, pneumonia and kidney disease on their own substantially doubled/tripled mortality risk. The risk increased from 10.1% (none of selected conditions), up to 28.9% when only one of selected comorbidities was present, rising to 52.3% (OR: 9.34; p < 0.001) when two or more comorbidities were simultaneously diagnosed, besides general symptoms. Conclusions Our study confirmed an important increase of in-hospital mortality in older subjects with dementia. Despite a different comorbidity, the conditions associated with in-hospital mortality were substantially the same in patients with or without dementia. Heart failure, pneumonia, and kidney disease identified a high risk of in-hospital mortality among subjects with dementia.