Objective To investigate the relationship between plasma hemoglobin A1c (HbA1c) level and long-term all-cause mortality in patients with coronary heart disease. Methods Inpatients diagnosed with coronary heart disease by coronary angiography and treated in the Department of Cardiovascular Medicine of the People′s Hospital of Guangxi Zhuang Autonomous Region from January 2020 to December 2021 were included. Kaplan-Meier survival curve, multivariate Cox regression model analysis, and restricted cubic spline were used to explore the relationship between plasma HbA1c level and long-term all-cause mortality risk in patients with coronary heart disease. Results A total of 1,755 patients with coronary heart disease were included. During the 1-year follow-up period, a total of 99 patients (5.6%) died. The Kaplan-Meier survival curve analysis showed that patients with coronary heart disease would have had an increased long-term all-cause mortality risk if the plasma HbA1c level had been too low or too high (P<0.05). The results of multivariate Cox regression analysis showed that the plasma HbA1c level, age, chronic kidney disease, and use of β-receptor blocker were influencing factors of long-term all-cause mortality in patients with coronary heart disease; compared with patients with coronary heart disease and the plasma HbA1c level of 5.6 mmol/L~<5.9 mmol/L, the long-term all-cause mortality risk was significantly increased in patients with coronary heart disease and the plasma HbA1c level <5.6 mmol/L or the plasma HbA1c level ≥6.3 mmol/L (all P<0.05). The restricted cubic spline showed that after adjusting age, chronic kidney disease, and use of β-receptor blocker, the plasma HbA1c level had a nonlinear relationship with long-term all-cause mortality in patients with coronary heart disease. Conclusion The plasma HbA1c level has a nonlinear relationship with long-term all-cause mortality in patients with coronary heart disease, and a too-high or too-low plasma HbA1c level increases the long-term all-cause mortality risk in patients with coronary heart disease.