Magnesium (Mg) is the second most abundant intracellular cation and plays a significant role in immune system and cardiac protection. Mg deficiency contributes to chronic low-grade inflammation leading to cardiovascular diseases, and low Mg level exacerbates virus-induced inflammation. The aim of the study was to investigate whether serum magnesium level is associated with myocardial damage and prognosis of COVID-19. This was a single-center, observational retrospective study of patients with COVID-19. The study population was divided into two groups according to in-hospital mortality: a survivor group (SG) and a non-survivor group (NSG). Myocardial damage was defined as blood levels of cardiac troponin I (cTnI) above the 99th percentile upper reference limit. Magnesium, variables regarding inflammation, and myocardial damage were compared between the groups. A total of 629 patients with COVID-19 were included. Mortality rate was 11.85% (n = 82). There were 61 (74.4%) and 294 male patients (53.7%) in NSG and SG, respectively (p = 0.001). The median age of NSG was 64.5 years (min-max: 37-93) and the median age of SG was 56.0 years (min-max: 22-92) (p < 0.001). Median serum magnesium levels of NSG and SG were 1.94 mg/dL (min-max: 1.04-2.87) and 2.03 mg/dL (min-max: 1.18-2.88), respectively (p = 0.027). Median cTnI levels of NSG and SG were 25.20 pg/mL (min-max: 2.10-2240.80) and 4.50 pg/mL (min-max: 0.50-984.3), respectively (p < 0.001). The cTnI levels were lower in those patients whose serum Mg levels were higher than 1.94. Although serum magnesium level was not a predictor for in-hospital mortality, there was a significant negative correlation between magnesemia and myocardial damage.