Background: Diabetes Mellitus (DM) has been associated with a higher Coronavirus disease-19 (COVID-19) mortality, both in hospitalized patients and in the general population. A possible beneficial effect of metformin on the prognosis of COVID-19 has been reported in some observational studies, whereas other studies disagree. Methods: To investigate the possible effect of metformin on COVID-19 in-hospital mortality, we performed a retrospective study that included all SARS-CoV-2-positive patients with DM who were admitted to two Italian hospitals. In order to adjust for possible confounders accounting for the observed reduction of mortality in metformin users, we adopted the COVID-19 Mortality Risk Score (COVID-19 MRS) as a covariate. Results: Out of the 524 included patients, 33.4% died. A binomial logistic regression showed that metformin use was associated with a significant reduction in case fatality (OR 0.67 [0.45-0.98], p = 0.039), with no significant effect on the need for ventilation (OR 0.75 [0.5-1.11], p = 0.146). After adjusting for COVID-19 MRS, metformin did not retain a significant association with in-hospital mortality [OR 0.795 (0.495-1.277), p = 0.342]. Conclusions: A beneficial effect of metformin on COVID-19 was not proven after adjusting for confounding factors. The use of validated tools to stratify the risk for COVID-19 severe disease and death, such as COVID-19 MRS, may be useful to better explore the potential association of medications and comorbidities with COVID-19 prognosis.