Diabetes is a risk factor for developing severe COVID-19, but the pathogenesis remains unclear. We investigated if the association of diabetes and COVID-19 severity may be mediated by inflammation. We also hypothesized that this increased risk may extend to prediabetes. Hospitalized patients in Singapore with COVID-19 were subdivided into three groups in a retrospective cohort: normoglycemia (HbA1c: ≤5.6%), prediabetes (HbA1c: 5.7%-6.4%) and diabetes (HbA1c: ≥6.5%). The primary outcome of severe COVID-19 was defined by respiratory rate ≥30, SpO2 ≤93% or intensive care unit admission. The association between clinical factors on severe COVID-19 outcome was analyzed by cox regression. Adjusted mediation analysis of C-reactive protein (CRP) on the relationship between diabetes and severe COVID-19 was performed. Of 1042 hospitalized patients, mean age 39 ± 11 years, 13% had diabetes, 9% prediabetes and 78% normoglycemia. Severe COVID-19 occurred in 4.9% of subjects. Compared to normoglycemia, diabetes was significantly associated with severe COVID-19 on both univariate (hazard ratio [HR]: 9.94; 95% confidence interval [CI]: 5.54-17.84; p < .001) and multivariate analysis (HR: 3.99; 95% CI: 1.92-8.31; p < .001), while prediabetes was not a risk factor (HR: 0.94; 95% CI: 0.22-4.03; p = .929). CRP, a biomarker of inflammation, mediated 32.7% of the total association between diabetes and severe COVID-19 outcome. In conclusion, CRP is a partial mediator of the association between diabetes and severe COVID-19 infection, confirming that inflammation is important in the pathogenesis of severe COVID-19 in diabetes.