---
title: "Serum Magnesium and Risk of Spontaneous Bacterial Peritonitis and Sepsis in Hospitalized Cirrhosis"
id: "frontiers-in-immunology-19-association-of-serum-magnesium-levels-with-the-risk-of-spontaneous-bacterial"
canonical_url: "https://medichelpline.com/clinical-feed/frontiers-in-immunology-19-association-of-serum-magnesium-levels-with-the-risk-of-spontaneous-bacterial"
content_type: "clinical_feed_article"
specialty: "Infectious Disease"
source_name: "Frontiers in Immunology"
source_url: "https://www.frontiersin.org/articles/10.3389/fimmu.2026.1857975"
published_at: "2026-09-15T00:00:00.000Z"
evidence_level: "Journal Feed"
license: "CC-BY-NC-4.0 / Informational Use"
---
# Serum Magnesium and Risk of Spontaneous Bacterial Peritonitis and Sepsis in Hospitalized Cirrhosis
## Provenance & Clinical Metadata
- **Canonical URL:** https://medichelpline.com/clinical-feed/frontiers-in-immunology-19-association-of-serum-magnesium-levels-with-the-risk-of-spontaneous-bacterial
- **Specialty:** [Infectious Disease](https://medichelpline.com/clinical-feed/infectious-disease.md)
- **Primary Source:** Frontiers in Immunology
- **Source URL:** [Original Journal Publication](https://www.frontiersin.org/articles/10.3389/fimmu.2026.1857975)
- **Published At:** 2026-09-15T00:00:00.000Z
- **Evidence Rating:** Journal Feed
## Executive GIST (TL;DR)
- This article title indicates a study of the association between **serum magnesium** levels and the risk of **spontaneous bacterial peritonitis** (SBP) and **sepsis** among hospitalized patients with **cirrhosis**. - The source is the journal Frontiers in Immunology; no study text or results were included in the supplied source content. - Key study elements commonly reported in cohort analyses — including cohort size, inclusion and exclusion criteria, magnesium measurement methods, definitions of SBP and sepsis, statistical methods, effect estimates, and follow-up duration — were not present in the provided source material. - Because the supplied content contains only website navigation and journal metadata, specific findings, numeric results, and authors' conclusions cannot be reported from this source. - Readers should consult the full published article at the journal site to access study population details, analytical methods, quantitative results, and authors' interpretations, which were not available in the provided excerpt.
## Clinical Analysis & Structured Key Points
Frontiers | Association of serum magnesium levels with the risk of spontaneous bacterial peritonitis and sepsis in hospitalized patients with cirrhosis: a retrospective cohort study 0.05). In addition, the areas under the receiver operating characteristic curves for serum magnesium in predicting HA-SBP and sepsis were 0.635 (95% CI: 0.583–0.686) and 0.688 (95% CI: 0.617–0.758), respectively.ConclusionsHypomagnesemia was associated with increased risks of HA-SBP and sepsis in patients with cirrhosis, and these findings should be further validated in prospective studies."> ORIGINAL RESEARCH article Front. Immunol. , 15 September 2026 Sec. Nutritional Immunology Volume 17 - 2026 | https://doi.org/10.3389/fimmu.2026.1857975 Published in Frontiers in Immunology Nutritional Immunology 7 impact factor 11.3 citescore Part of a Research Topic Micronutrients, Immunity and Infection: Volume II Submission open 11k views 8 articles Editor & Reviewers Edited by A F Adrian Friedrich Gombart Reviewed by A E Amal Elkhawaga K P KHIN PHYU PYAR Outline Figures and Tables Figure 1 View in article Figure 2 View in article Figure 3 View in article Table 1 Baseline clinical characteristics of patients with cirrhosis stratified by serum magnesium levels. View in article Table 2 Univariable logistic regression for hospital-acquired spontaneous bacterial peritonitis in patients with cirrhosis. View in article Table 3 Association of serum magnesium levels with HA-SBP and sepsis in patients with cirrhosis. . View in article ORIGINAL RESEARCH article Front. Immunol. , 15 September 2026 Sec. Nutritional Immunology Volume 17 - 2026 | https://doi.org/10.3389/fimmu.2026.1857975 Association of serum magnesium levels with the risk of spontaneous bacterial peritonitis and sepsis in hospitalized patients with cirrhosis: a retrospective cohort study X D Xiang-Jie Duan 1 † Y C Yang Cai 2 † Q S Qing Su 3 † Q Z Qin Zhou 4 M L Man Li 1 J C Jin-Lian Chen 1 C Z Chang-Yun Zhang 1 D Y Duo-Meng Yang 5 * H Y Hai-Yan Yin 1 * W G Wan-Jie Gu 1 * 1. Department of Intensive Care Unit, The First Affiliated Hospital of Jinan University, Guangzhou Guangdong, China 2. Department of Infectious Diseases, Changde Hospital, Xiangya School of Medicine, Central South University (The First People’s Hospital of Changde City), Changde, China 3. Department of Emergency, The First Affiliated Hospital of Jinan University, Guangzhou Guangdong, China 4. Department of Intensive Care Unit, Changde Hospital, Xiangya School of Medicine, Central South University (The First People’s Hospital of Changde City), Changde, China 5. Department of Pathophysiology, Key Laboratory of State Administration of Traditional Chinese Medicine of the People’s Republic of China, School of Medicine, Jinan University, Guangzhou, Guangdong, China See more Article metrics View details Abstract Background: Hypomagnesemia is common in patients with cirrhosis. This study aimed to examine the association between serum magnesium levels and the risks of hospital-acquired spontaneous bacterial peritonitis (HA-SBP) and sepsis. Methods: This retrospective study included patients with cirrhosis who were hospitalized at the First People’s Hospital of Changde City, China, between May 2021 and June 2025. The exposure variable was the first serum magnesium measurement obtained within 48 hours of admission. The primary outcome was HA-SBP, and the secondary outcome was sepsis. Multivariable regression and restricted cubic spline (RCS) analyses were used to assess the associations. Results: A total of 1110 patients with cirrhosis were included. The incidences of HA-SBP and sepsis were 12.25% and 6.06%, respectively. Multivariable regression analysis showed that per 1-SD increase in serum magnesium, the risks of HA-SBP and sepsis decreased by 20.8% (odds ratio [OR] = 0.792, 95% confidence interval [CI]: 0.642–0.970, P = 0.026) and 35.5% (OR = 0.645, 95% CI: 0.464–0.883, P = 0.008), respectively. Compared with normomagnesemia, hypomagnesemia was associated with increased risks of HA-SBP (OR = 1.520, 95% CI: 1.009–2.286, P = 0.044) and sepsis (OR = 2.213, 95% CI: 1.189–4.177, P = 0.013). Sensitivity analyses yielded consistent results. RCS analysis showed a linear inverse association between serum magnesium levels and the risks of HA-SBP and sepsis (both P for nonlinearity > 0.05). In addition, the areas under the receiver operating characteristic curves for serum magnesium in predicting HA-SBP and sepsis were 0.635 (95% CI: 0.583–0.686) and 0.688 (95% CI: 0.617–0.758), respectively. Conclusions: Hypomagnesemia was associated with increased risks of HA-SBP and sepsis in patients with cirrhosis, and these findings should be further validated in prospective studies. Introduction Patients with cirrhosis are prone to spontaneous bacterial peritonitis (SBP) because of portal hypertension, impaired intestinal barrier function, and immune dysfunction ( 1 ). The reported prevalence of SBP among hospitalized patients with cirrhosis ranges from 10.81% to 68.20% across different regions ( 2 ). SBP is an important trigger of acute decompensation in cirrhosis and is closely associated with increased risks of sepsis, organ failure, and short-term mortality ( 1 ). Studies have shown that with the spread of multidrug-resistant bacteria and worsening antimicrobial resistance, the clinical burden and mortality risk of cirrhosis-related SBP continue to increase ( 3 ). Since the management of SBP depends on early recognition and timely intervention, identifying early predictors of SBP is of important clinical significance for improving the prognosis of patients with cirrhosis. Magnesium is the second most abundant intracellular cation in the human body and plays an important role in energy metabolism, protein synthesis, regulation of inflammation, and maintenance of immune homeostasis ( 4 ). Serum magnesium is a simple and readily available biomarker that can partly reflect magnesium status ( 5 ). However, hypomagnesemia is an easily overlooked electrolyte disorder in hospitalized patients ( 6 ). Patients with cirrhosis are more likely to experience magnesium loss or deficiency because of inadequate intake, impaired intestinal absorption, medication use, and renal dysfunction, thereby increasing the risk of hypomagnesemia ( 7 , 8 ). In addition, studies have shown that serum magnesium levels may further decline with increasing severity of liver disease ( 9 ). Several studies have shown that hypomagnesemia is closely associated with various adverse outcomes in patients with cirrhosis, including acute kidney injury, hepatic encephalopathy, and hepatocellular carcinoma ( 7 , 9 – 12 ). However, evidence regarding the relationship between serum magnesium levels and infectious complications such as SBP and sepsis in patients with cirrhosis remains limited ( 13 – 15 ). Given the complex mechanisms underlying cirrhosis-related infections, the association between serum magnesium levels and infection outcomes may be nonlinear. Therefore, this study aimed to evaluate the association between serum magnesium levels and the risks of hospital-acquired spontaneous bacterial peritonitis (HA-SBP) and sepsis in a real-world cohort of hospitalized patients with cirrhosis. Materials and methods Study population This retrospective cohort study included adult patients with cirrhosis who were hospitalized at the First People’s Hospital of Changde City, China, between May 2021 and June 2025. The First People’s Hospital of Changde City is a major tertiary teaching hospital in northwestern Hunan Province, China, with a large clinical database of patients with cirrhosis. Patients with cirrhosis were identified using discharge diagnosis codes based on the International Classification of Diseases, Tenth Revision, which have a positive predictive value exceeding 90% ( 16 , 17 ) ( Supplementary Materials and Method A ). The exclusion criteria were as follows: (1) no serum magnesium measurement within 48 hours after admission; (2) age 1.02 mmol/L). The primary outcome was HA-SBP. Community-acquired SBP was defined as SBP diagnosed at admission or within 48 hours after admission. HA-SBP was defined as SBP diagnosed more than 48 hours after admission ( 19 , 20 ). SBP was diagnosed based on an ascitic fluid polymorphonuclear leukocyte count ≥ 0.25 × 10 9 /L (250 cells/mm³) and/or a positive ascitic fluid bacterial culture, regardless of the presence of clinical symptoms ( 21 , 22 ). In clinical practice, diagnostic paracentesis or therapeutic paracentesis drainage is performed only when patients with cirrhosis have clinical indications. The secondary outcome was sepsis, identified using discharge diagnosis codes (ICD-10 codes A40.x and A41.x), with septic shock identified using ICD-10 code R57.2. Patients with sepsis at admission were excluded from the analysis of the sepsis outcome (N = 4). Data collection and management We collected the following data from the hospital electronic medical record system: age, sex, hepatitis B virus infection, hepatitis C virus infection, alcohol use history, hypertension, diabetes mellitus, renal disease, severe liver disease, cancer, Charlson Comorbidity Index, mean arterial pressure, high-sensitivity C-reactive protein, white blood cell count, platelet count, serum albumin, total bilirubin, serum creatinine, serum sodium, serum magnesium, international normalized ratio, Model for End-Stage Liver Disease (MELD) 3.0 score, and diuretic use. Comorbidities were identified through review of medical records and discharge diagnosis codes. Mean arterial pressure and laboratory variables were defined as the first values measured within 48 hours of admission. The MELD 3.0 score was calculated preferentially using variables measured within 24 hours of admission; if these variables were unavailable, data obtained between 24 and 48 hours after admission were used. Diuretic use was defined as the use of diuretics between admission and serum magnesium measurement and was further categorized into loop diuretics and potassium-sparing diuretics. In real-world studies, outliers and missing values are common. For laboratory variables, outliers were identified using the percentile method, and values below the 1st percentile or above the 99th percentile were considered outliers and treated as missing values. To reduce bias caused by missing data, variables with more than 30% missing values were excluded ( Supplementary Figure S1 ). For variables included in the analysis, five imputation algorithms (mean, predictive mean matching, lasso.norm, random forest, and classification and regression tree) were used to generate five imputed datasets, and the mean of the imputed values was used as the final analytical dataset ( 23 ). Statistical analysis All statistical analyses were performed using R software (version 4.5.0). Continuous variables with a normal or approximately normal distribution were presented as mean ± standard deviation, whereas non-normally distributed continuous variables were presented as median (interquartile range). Categorical variables were presented as counts and percentages. For between-group comparisons, normally distributed continuous variables were analyzed using one-way analysis of variance, non-normally distributed continuous variables were analyzed using the Kruskal–Wallis rank-sum test, and categorical variables were analyzed using the chi-square test or Fisher’s exact test. Multivariable logistic regression models were used to evaluate the independent associations between serum magnesium levels and HA-SBP and sepsis, with results reported as odds ratios (ORs) and 95% confidence intervals (CIs). Potential confounders were selected based on previous literature, clinical relevance, and univariable analysis results, and variance inflation factors (VIFs) were used to assess multicollinearity among variables in the models. A VIF > 5 was considered indicative of multicollinearity ( Supplementary Figure S2 ). Three models were constructed. Model 1 was an unadjusted model. Model 2 was adjusted for age, sex, diabetes mellitus, severe liver disease, and Charlson Comorbidity Index. Model 3 was further adjusted for mean arterial pressure, white blood cell count, high-sensitivity C-reactive protein, serum albumin, total bilirubin, serum sodium, international normalized ratio, MELD 3.0 score, loop diuretic use and potassium-sparing diuretic use in addition to the variables included in Model 2. To explore the dose–response relationships between serum magnesium levels and the study outcomes, restricted cubic spline (RCS) regression analyses were performed with adjustment for the covariates included in Model 3. Subgroup analyses were conducted to assess the consistency of the associations across clinically relevant subgroups. Subgroup variables included age, sex, diabetes mellitus, severe liver disease, hepatitis B virus infection, and MELD 3.0 score, and interactions were evaluated using likelihood ratio tests. Receiver operating characteristic (ROC) curve analysis was performed to evaluate the predictive performance of serum magnesium levels for HA-SBP and sepsis. We performed seven sensitivity analyses to assess the robustness of the results. First, we excluded patients who had fever at admission and leukocytosis within 48 hours after admission. Second, we excluded patients who had abdominal pain at admission and leukocytosis within 48 hours after admission. Third, we adjusted the thresholds for serum magnesium and categorized it into four groups. Fourth, we restricted the analysis to patients with ascites within 48 hours after admission. Fifth, we excluded patients who received magnesium supplementation within 48 hours after admission. Sixth, we excluded patients with diarrhea at admission. Seventh, we excluded patients who received sodium–glucose cotransporter 2 inhibitors within 48 hours after admission. All tests were two-sided, and P 1.02 mmol/L, N = 47) P - value Magnesium (mmol/L) 0.80 (0.13) 0.66 (0.07) 0.85 (0.07) 1.12 (0.13) <0.001 Age (yr) 63.7 (11.9) 63.0 (11.7) 63.9 (12.1) 64.7 (11.1) 0.400 Sex, n (%) 0.557 Female 395 (35.6%) 115 (33.3%) 262 (36.5%) 18 (38.3%) Male 715 (64.4%) 230 (66.7%) 456 (63.5%) 29 (61.7%) Medical history, n (%) Hepatitis B virus infection 372 (33.5%) 105 (30.4%) 252 (35.1%) 15 (31.9%) 0.312 Hepatitis C virus infection 57 (5.1%) 24 (7.0%) 31 (4.3%) 2 (4.3%) 0.180 Alcohol use 192 (17.3%) 76 (22.0%) 109 (15.2%) 7 (14.9%) 0.020 Hypertension 406 (36.6%) 113 (32.8%) 275 (38.3%) 18 (38.3%) 0.207 Diabetes mellitus 400 (36.0%) 130 (37.7%) 260 (36.2%) 10 (21.3%) 0.088 Renal disease 272 (24.5%) 85 (24.6%) 173 (24.1%) 14 (29.8%) 0.678 Severe liver disease 505 (45.5%) 184 (53.3%) 292 (40.7%) 29 (61.7%) <0.001 Cancer 185 (16.7%) 51 (14.8%) 121 (16.9%) 13 (27.7%) 0.083 Charlson Comorbidity Index 6.0 (4.0, 8.0) 6.0 (4.0, 8.0) 6.0 (4.0, 8.0) 7.0 (5.0, 9.0) 0.101 Mean arterial pressure, mmHg 91.0 (14.1) 88.4 (15.7) 91.9 (13.1) 95.6 (13.1) <0.001 High-sensitivity CRP, mg/L 12.1 (3.4, 31.2) 15.0 (5.6, 39.8) 10.9 (2.8, 27.2) 6.7 (1.8, 26.2) <0.001 White blood cell count, ×10 9 /L 5.3 (3.8, 7.4) 5.6 (3.8, 8.8) 5.1 (3.8, 7.0) 5.6 (3.6, 8.1) 0.003 Platelet count, ×10 9 /L 96.8 (62.0, 141.0) 87.0 (57.0, 126.0) 102.0 (65.0, 145.7) 94.0 (56.0, 135.0) 0.006 Serum albumin, g/L 33.2 (6.6) 30.4 (6.5) 34.4 (6.1) 36.5 (7.3) <0.001 Total bilirubin, μmol/L 18.8 (11.2, 31.5) 21.6 (11.8, 40.3) 16.9 (10.7, 28.0) 23.8 (12.5, 38.5) <0.001 Serum creatinine, μmol/L 78.0 (60.0, 121.0) 77.0 (58.0, 119.0) 78.0 (60.0, 122.0) 76.0 (61.0, 122.5) 0.631 Serum sodium, mmol/L 138.8 (3.9) 138.2 (4.2) 139.2 (3.7) 138.1 (4.1) <0.001 International normalized ratio 1.2 (0.3) 1.3 (0.3) 1.2 (0.3) 1.2 (0.4) <0.001 MELD 3.0 score 11.2 (7.3, 18.2) 14.5 (8.9, 20.4) 9.7 (7.3, 16.3) 9.5 (7.3, 18.2) <0.001 Diuretic use, n (%) 208 (18.7%) 74 (21.4%) 124 (17.3%) 10 (21.3%) 0.237 Loop diuretic use 182 (16.4%) 61 (17.7%) 112 (15.6%) 9 (19.1%) 0.604 Potassium-sparing diuretic use 71 (6.4%) 21 (6.1%) 41 (5.7%) 9 (19.1%) 0.005 Time to HA-SBP diagnosis, days 5.4 (3.7, 8.8) 6.1 (5.2, 12.7) 4.4 (3.5, 7.5) 6.9 (4.1, 8.0) 0.290 Length of hospital stay, days 7.9 (5.6, 12.0) 8.8 (5.9, 13.1) 7.6 (5.1, 11.2) 7.7 (5.2, 11.5) 0.007 HA-SBP, n (%) 136 (12.25%) 64 (18.55%) 65 (9.05%) 7 (14.89%) <0.001 Sepsis, n (%) 67 (6.06%) 39 (11.34%) 27 (3.78%) 1 (2.13%) <0.001 Baseline clinical characteristics of patients with cirrhosis stratified by serum magnesium levels. Continuous data are expressed as mean (SD) or median (IQR). CRP, C-reactive protein; MELD, Model for End-Stage Liver Disease; HA-SBP, hospital-acquired spontaneous bacterial peritonitis; SD, standard deviation; IQR, interquartile range. Supplementary Figure S3 shows the distribution of serum magnesium levels, with a mean value of 0.80 ± 0.13 mmol/L. Compared with patients without HA-SBP, those with HA-SBP had significantly lower serum magnesium levels (0.75 ± 0.14 mmol/L vs 0.81 ± 0.13 mmol/L, P < 0.001). Similarly, patients with sepsis had significantly lower serum magnesium levels than those without sepsis (0.72 ± 0.16 mmol/L vs 0.81 ± 0.13 mmol/L, P < 0.001) ( Figure 2 ). Figure 2 Serum magnesium levels stratified by outcome status. (A) Hospital-acquired spontaneous bacterial peritonitis. (B) Sepsis. **** indicates P < 0.0001. Baseline characteristics according to serum magnesium status are shown in Table 1 . The overall prevalence of hypomagnesemia was 31.08% (345/1110). Compared with normomagnesemia, the hypomagnesemia group had higher proportions of alcohol use and severe liver disease. In addition, the hypomagnesemia group had lower mean arterial pressure, platelet count, serum albumin, and serum sodium, but higher high-sensitivity C-reactive protein, white blood cell count, total bilirubin, international normalized ratio, MELD 3.0 score, and a longer hospital stay ( Table 1 ). Furthermore, the incidences of HA-SBP were 18.55%, 9.05%, and 14.89% in the hypomagnesemia, normomagnesemia, and hypermagnesemia groups, respectively (P < 0.001), whereas the corresponding incidences of sepsis were 11.34%,
## Related Clinical Research

- [Iron-related Parameters and Sepsis-associated Acute Kidney Injury — Source Content Not Available](https://medichelpline.com/clinical-feed/frontiers-in-immunology-19-association-of-iron-related-parameters-with-the-development-of-sepsis.md)
- [Consensus recommendations to prevent and manage immunoglobulin therapy adverse reactions in primar](https://medichelpline.com/clinical-feed/frontiers-in-immunology-4-expert-consensus-recommendations-for-the-prevention-and-management-of.md)
- [Mortality and Predictors Among People Living with HIV Newly Enrolled in Care at Bamenda Regional H](https://medichelpline.com/clinical-feed/medrxiv-11-mortality-and-associated-factors-among-people-living-with-hiv-newly-initiated.md)
- [Biomarker Use for Acute Kidney Injury in Critically Ill Patients: Systematic Evidence Map and Prac](https://medichelpline.com/clinical-feed/pubmed-42725835.md) (DOI: 10.1097/CCM.0000000000007362)
- [SGLT2 Inhibitors and Infection Outcomes in CKD Patients with Type 2 Diabetes: Sepsis, Mortality, a](https://medichelpline.com/clinical-feed/pubmed-42711252.md) (DOI: 10.23876/j.krcp.26.134)

## Navigation
- [← Back to Infectious Disease Feed](https://medichelpline.com/clinical-feed/infectious-disease.md)
- [← All Clinical Specialties](https://medichelpline.com/clinical-feed.md)
## Medical & Regulatory Disclaimer

> [!CAUTION]
> MedicHelpline content is structured for research, educational, and professional discovery purposes. It does not constitute individual medical advice, clinical diagnosis, or treatment recommendations.
> Always verify dosing, contraindications, and regulatory alerts against official product labeling and primary regulatory sources before clinical decision-making.