Background: Heart failure (HF) has been classified into distinct phenotypes based on left ventricular ejection fraction (LVEF). We conducted this retrospective cohort study to explore the long-term survival prognosis of different types of HF especially the HF with improved ejection fraction (HFimpEF) group. Methods: We collected patients who had ever been hospitalized owing to coronary artery disease or acute coronary syndrome between July 2006 and June 2017 at National Taiwan University Hospital (NTUH) and NTUH Hsin-Chu Branch. Patients were classified as (1) HF with reduced ejection fraction (HFrEF); (2) HFimpEF; (3) HF with mildly reduced ejection fraction (HFmrEF); (4) HF with preserved ejection fraction (HFpEF); according to echocardiography-derived LVEF during or after the index hospitalization. The date of the first echocardiography during or after the index hospitalization was defined as the index date. All patients were followed from their index date until death or the end of the study (December 31 2017), whichever occurred first. Results: Totally, 11549 patients were categorized into 4 groups (HFrEF group, n = 986; HFimpEF group, n = 461; HFmrEF group, n = 1454; and HFpEF group, n = 8648). The crude mortality rate during follow-up in HFrEF group, HFimpEF group, HFmrEF group, and HFpEF group was 60.4%, 28.0%, 36.6%, and 18.3%, respectively. Patients in HFimpEF group, HFmrEF group, and HFpEF group all possessed a significantly reduced risk of all-cause mortality compared with HFrEF group (adjusted hazard ratio [HR] 0.241, 95% confidence interval [CI] 0.199-0.292 for HFimpEF group; 0.443, 95% CI 0.393-0.500 for HFmrEF group; and 0.292, 95% CI 0.262-0.324 for HFpEF group). Using the time-varying Cox regression model to deal with the immortal time bias, we found a persistent lower risk of all-cause mortality in patients in HFimpEF group compared with patients in HFrEF group (adjusted HR 0.579, 95% CI 0.467-0.718). Conclusion: Patients in HFrEF group had the worst long-term survival prognosis and patient in HFpEF group had the best long-term survival prognosis. Patients in HFimpEF group represented a distinctive population with good survival prognosis than HFrEF group and HFmrEF group.