Thongprayoon et al. found in a study of 12,599 non-dialysis adult hospitalized patients that serum calcium (SC) disturbances affected more than half of the patients and were associated with increased in-hospital mortality. Similar impacts of SC disturbances on in-hospital mortality have been observed in patients with acute myocardial infarction and the general hospitalized population. Atrial fibrillation (AF), the most common arrhythmia in the intensive care unit (ICU), affects around 6% of critically ill patients. However, the significance of the relationship between SC levels and in-hospital mortality in these patients remains unclear. This study aimed to explore the correlation between SC levels and in-hospital mortality in ICU patients diagnosed with AF. Data from the MIMIC-IV database included 11,621 AF patients (average age 75.59 ± 11.74 years; 42.56% male), with an in-hospital mortality rate of 8.90%. A nonlinear relationship between SC levels and in-hospital mortality was observed. Effect sizes on either side of the inflection point were 0.79 (HR: 0.79, 95% CI 0.67–0.94, P = 0.006) and 1.12 (HR: 1.12, 95% CI 1.01–1.25, P = 0.029). Sensitivity analyses confirmed these results. SC levels around 8.56 mg/dL were associated with the lowest risk of in-hospital mortality, with risks increasing as SC levels deviated from this point. SC levels below this inflection point were linked to more pronounced clinical impacts. This finding has significant clinical implications for clinicians. Therefore, in the treatment of ICU patients with AF, clinicians should closely monitor SC levels, with a focus on maintaining them around 8.56 mg/dL.