The association between serum calcium levels and the prognosis of patients with acute myocardial infarction (AMI) remains controversial. This study aimed to explore the association between serum calcium and in-hospital mortality in patients with AMI. The data of this study were extracted from the Philips eICU Collaborative Research Database. A total of 7284 patients were eventually enrolled in this study, of which 799 (10.97%) died during hospitalization. For each patient, serum calcium, corrected to albumin, was calculated and categorized into four groups: Q1 ≤ 8.5, Q2 8.5–9.5, Q3 9.5–10.5, and Q4 > 10.5 mg/dL. Multivariate analysis demonstrated that corrected sCa was an independent predictor of in-hospital death (Q2 vs. Q1, OR 0.5, 95% CI 0.4–0.7, P < 0.001; Q3 vs. Q1, OR 0.8, 95% CI 0.6–1.0, P = 0.035; Q4 vs. Q1, OR 1.6, 95% CI 1.1–2.3, P = 0.008). The association remained stable in the fully adjusted model. A significant U-shaped association between corrected serum calcium and in-hospital mortality was observed in piecewise linear regression model (Corrected sCa < 9.4 mg/dL, OR 0.8, 95% CI 0.7–0.9, P < 0.001; corrected sCa > 9.4 mg/dL, OR 1.5, 95% CI 1.3–1.8, P < 0.001). In conclusion, both decreased and increased corrected serum calcium is associated with increased in-hospital mortality in patients with AMI, and patients may have the lowest risk of in-hospital death when corrected serum calcium is 9.4 mg/dL (2.35 mmol/L).