Objective: To investigate the changes of Mg2+ levels in serum and peripheral blood mononuclear cells (PBMCs) of patients with COVID-19 and its effects on the functions of CD8+ T lymphocytes and NK cells. Methods: A total of 165 COVID-19 patients hospitalized in Ezhou Central Hospital from January 20 to February 20, 2020 were divided into mild/common group (98 cases) and severe/critical group (67 cases). At the same time, 34 healthy persons were selected as the control group. Peripheral blood was collected and PBMCs were isolated, the level of Mg2+ in serum and PBMCs was detected. The subsets of CD8+ T lymphocytes and NK cell and the expression levels of their surface inhibitory molecular PD-1 and activator molecular NKG2D were detected by flow cytometry. The correlation between Mg2+ concentration and the expression levels of PD-1 and NKG2D was also analyzed. Results: Compared with the control group, the concentration of Mg2+ in serum and PBMCs, the counts of CD8+ T lymphocytes and NK cell in patients with mild/common and severe/critical groups were significantly reduced (P<0.05), while the expression level of surface inhibitory molecular PD-1 were significantly increased (P<0.05), while the expression level of the activation molecule NKG2D were significantly decreased (P<0.05). However, the changes of the above indicators in patients with severe/critical group were greater than those in the mild/common group (P<0.05). In addition, the Mg2+ concentration in COVID-19 patients was negatively correlated with the expression level of PD-1 on CD8+ T lymphocytes and NK cells (P<0.05), and positively correlated with the expression levels of NKG2D (P<0.05). Conclusion: The concentration of Mg2+ in the serum and PBMCs of COVID-19 patients is significantly reduced, which may cause the function of CD8+ T lymphocytes and NK cells to be inhibited.