The relationship between serum calcium levels and the prognosis of cerebral infarction remains controversial. This study aims to investigate the correlation between serum calcium levels and in-hospital mortality in critically ill patients with ischemic stroke admitted to the intensive care unit (ICU). A retrospective cohort study was conducted using data from the MIMIC-IV database. Demographic and clinical data of all participants were collected including gender, age, hypertension, diabetes, myocardial infarction, heart failure, chronic obstructive pulmonary disease, hemoglobin, potassium, sodium, anion gap, platelets, white blood cells, glucose, creatinine, Glasgow coma score (GCS), IV-tPA administration (rt-PA), and mechanical thrombectomy (MT). The outcome measure was in-hospital death. Multivariable-adjusted logistic regression analysis, curve fitting, interaction analysis, and threshold effect analysis were employed to evaluate the relationship between serum calcium levels and in-hospital mortality among ICU patients with cerebral infarction. A total of 2,680 critically ill patients with cerebral infarction were enrolled, with a mean serum calcium level of 8.6 ± 0.8 mg/dL. The overall in-hospital mortality rate was 19.5%, where Group 1 (serum calcium < 8.0 mg/dL) had a mortality rate of 27.7%, Group 2 (serum calcium 8-9 mg/dL) had a rate of 19.8%, and Group 3 (serum calcium ≥ 9 mg/dL) had a rate of 13.9%. There was a non-linear, S-shaped relationship between serum calcium levels and in-hospital mortality. Serum calcium levels within the range of 7.70-9.50 mg/dL were found to be independently associated with increased in-hospital mortality in ICU patients with cerebral infarction. No significant interactions were detected in subgroup analyses, and the results of sensitivity analyses remained stable. Serum calcium levels are independently associated with in-hospital mortality in critically ill patients with cerebral infarction in the ICU setting. Within the range of 7.70-9.50 mg/dL, lower serum calcium levels increase the risk of in-hospital death among these patients, emphasizing the importance of close monitoring by ICU physicians.