AimThis study’s objective was to assess the risk of severe in-hospital complications of patients admitted for COVID-19 and diabetes mellitus (DM).DesignThis was a cross-sectional study.SettingsWe used pseudonymised medical record data provided by six general hospitals from the HM Hospitales group in Spain.Outcome measuresMultiple logistic regression analyses were used to identify variables associated with mortality and the composite of mortality or invasive mechanical ventilation (IMV) in the overall population, and stratified for the presence or absence of DM. Spline analysis was conducted on the entire population to investigate the relationship between glucose levels at admission and outcomes.ResultsOverall, 1621 individuals without DM and 448 with DM were identified in the database. Patients with DM were on average 5.1 years older than those without. The overall in-hospital mortality was 18.6% (N=301), and was higher among patients with DM than those without (26.3% vs 11.3%; p<0.001). DM was independently associated with death, and death or IMV (OR=2.33, 95% CI: 1.7 to 3.1 and OR=2.11, 95% CI: 1.6 to 2.8, respectively; p<0.001). In subjects with DM, the only variables independently associated with both outcomes were age >65 years, male sex and pre-existing chronic kidney disease. We observed a non-linear relationship between blood glucose levels at admission and risk of in-hospital mortality and death or IMV. The highest probability for each outcome (around 50%) was at random glucose of around 550 mg/dL (30.6 mmol/L), and the risks flattened above this value.ConclusionThe results confirm the high burden associated with DM in patients hospitalised with COVID-19 infection, particularly among men, the elderly and those with impaired kidney function. Moreover, hyperglycaemia on admission was strongly associated with poor outcomes, suggesting that personalised optimisation could help to improve outcome during the hospital stay.