AimsAcute myocardial infarction (AMI) is a cardiovascular disease with high morbidity and mortality. We collected patients with AMI from the Medical Information Mart for Intensive Care IV (v2.0) database and explored the association between serum albumin‐corrected anion gap (ACAG) level and mortality in patients with AMI.Methods and resultsData of adult patients with AMI were collected. According to the 360 day prognosis, patients were divided into survival and non‐survival groups. Based on the ACAG level, patients were then divided into normal and high ACAG groups. Cox hazard proportional models and restricted cubic splines (RCSs) were used to investigate the correlation between ACAG and mortality. Kaplan–Meier curves were created to compare the cumulative survival rates between the high and normal ACAG groups. The receiver operating characteristic (ROC) curve was used to analyse the predictive value of ACAG for the prognosis of patients with AMI. Sensitivity and subgroup analyses were conducted to revalidate the results. Finally, 1783 patients were included. Elevated ACAG (>20 mmol/L) was significantly associated with 30 and 360 day mortality (P < 0.001). Adjusted for multiple confounding factors, the Cox proportional hazard analysis showed that elevated ACAG (>20 mmol/L) was an independent risk factor of increased all‐cause mortality in patients with AMI (hazard ratio 1.423, 95% confidence interval 1.206–1.678, P < 0.001). RCS analysis further showed that there was a non‐linear trend relationship between ACAG and the risk of all‐cause mortality at 30 and 360 days (χ2 = 10.750, P = 0.013; χ2 = 13.960, P = 0.003). Kaplan–Meier survival curves showed that the 30 and 360 day cumulative survival rates of patients with AMI were significantly lower (log‐rank test, χ2 = 98.880, P < 0.001; χ2 = 105.440, P < 0.001) in the high ACAG group. ROC curve analysis showed that the area under the curve (AUC) of ACAG was 0.651, while the AUC of anion gap (AG) was 0.609, indicating that ACAG had a higher predictive value for 360 day mortality than AG. When combined with Sequential Organ Failure Assessment score, the predictive performance of ACAG for 360 day mortality was better, with an AUC of 0.699. Sensitivity and subgroup analyses were conducted suggesting the stability of our results.ConclusionsElevated serum ACAG (≥20 mmol/L) is an independent risk factor for short‐term and long‐term mortality in critically ill patients with AMI, and it may assist clinicians and nurses identifying high‐risk patients.