Background: Low magnesium levels are associated with an elevated risk of stroke. In this study, we investigated the association between magnesium levels on hospital admission and in-hospital mortality in acute ischemic stroke (AIS) patients. Methods: A total of 2,485 AIS patients, enrolled from December 2013 to May 2014 across 22 hospitals in Suzhou city, were included in this study. The patients were divided into 4 groups according to their level of admission magnesium: Q1 (<0.82 mmol/L), Q2 (0.82-0.89 mmol/L), Q3 (0.89-0.98 mmol/L), and Q4 (≥0.98 mmol/L). Cox proportional hazard model was used to estimate the effect of magnesium on all-cause in-hospital mortality in AIS patients. Results: During hospitalization, 92 patients (3.7%) died from all causes. The lowest serum magnesium level (Q1) was associated with a 2.66-fold increase in the risk of in-hospital mortality in comparison to Q4 (hazard ratio [HR] 2.66; 95% CI 1.55-4.56; p-trend < 0.001). After adjusting for age, sex, time from onset to hospital admission, baseline National Institutes of Health Stroke Scale score, and other potential covariates, HR for Q1 was 2.03 (95% CI 1.11-3.70; p-trend = 0.014). Sensitivity and subgroup analyses further confirmed a significant association between lower magnesium levels and a high risk of in-hospital mortality. Conclusions: Decreased serum magnesium levels at admission were independently associated with in-hospital mortality in AIS patients.