Background: Magnesium (Mg) deficiency is a common clinical electrolyte abnormality in critically ill patients, which is related to higher mortality and is easily ignored. Objectives: We aimed to investigate the association of Mg levels with mortality and comorbidity in patients admitted to the intensive care unit (ICU) based on COVID-19 infection classification. Methods: A total of 69 patients admitted to the ICU of Shahid Mohammadi Hospital, Bandar Abbas, Iran, from June to December 2021were included in the present study. The serum Mg was measured in these patients. Data from sequential organ failure assessment (SOFA), acute physiologic assessment and chronic health evaluation (APACHE), ICU stay length, mechanical ventilation duration, mortality, and comorbidity were determined. Moreover, the COVID-19 infection was detected by PCR. Results: The mean ± SD age of patients (34.8% male) was 52.56 ± 16.43 years. Out of 69 patients, 18 (26.1%) died during hospitalization, and 24 (34.8%) required mechanical ventilation. The prevalence of COVID-19 was 39.1% (27 patients). Our results showed no difference in serum Mg between patients based on mortality and comorbidity status. However, the Mg level of patients with kidney failure was significantly higher than patients without kidney failure (P < 0.05). Based on the COVID-19 classification, there was only a positive correlation between hypomagnesemia and the length of ICU hospitalization in patients without COVID-19 (P < 0.05). Conclusions: Our findings showed no difference in the Mg levels of patients based on mortality status. Patients with kidney failure had higher serum Mg than those without kidney failure. Furthermore, our results showed no difference in the Mg levels of critically ill patients based on COVID-19 infection status.