Background Altered serum magnesium (Mg) level in the human body has been hypothesized to have a role in the prediction of hospitalization and mortality; however, the reported outcomes are not conclusive. Aims The present study aimed to analyze the relationship between serum Mg and in-hospital mortality (IHM) in patients admitted to the medical ward of two hospitals in the Veneto region (Italy). Methods Patients > 18 years hospitalized in the medical wards of the hospitals of Vittorio Veneto and Conegliano, Italy (from January 12, 2011, through December 27, 2016) with at least one measurement of serum Mg were included in the study. A logistic regression model was used to assess the unadjusted and adjusted (by age, gender, Charlson Comorbidity index, discharge diagnosis’ class) association of serum Mg and IHM. Results In total 5024 patients were analyzed, corresponding to 6980 total admissions. The unadjusted analysis showed that IHM risk was significantly higher with 0.2 mg/dl incremental serum Mg level change from 2.4 mg/dl to 2.6, (OR 1.71 95% CI 1.55–1.89) and with 0.2 mg/dl change from serum Mg level of 1.4 mg/dl to 1.2 mg/dl, (OR 1.28 95% CI 1.17–1.40). Such results were confirmed at adjusted analysis. Discussion Present findings have relevant implications for the clinical management of patients suffering from medical condi-tions, highlighting the need for analyzing Mg concentration carefully. Conclusions Serum Mg levels seem to be a good predictor of IHM.