BACKGROUND: Although recent clinical trials raised concerns about the risk for heart failure (HF) in dipeptidyl peptidase-4 (DPP-4) inhibitor use, data on the cardiovascular risks in the patients with pre-existing HF are still lacking. METHODS: We used Taiwan's National Health Insurance Research Database to identify 196 986 patients diagnosed with type 2 diabetes mellitus (T2DM) who had previous history of HF between 2009 and 2013. This population included 30 204 DPP-4 inhibitor users and 166 782 propensity score-matched DPP-4 inhibitor non-users. The outcomes of interest were all-cause mortality, combination of myocardial infarction (MI) and ischaemic stroke, and hospitalisation for HF. RESULTS: The incidence in DPP-4 users compared with non-users was 67.02 vs 102.85 per 1000 person-years for all-cause mortality, 37.89 vs 47.54 per 1000 person-years for the combination of MI and ischaemic stroke, 12.70 vs 16.18 per 1000 person-years for MI and 26.37 vs 32.46 per 1000 person-years for ischaemic stroke. The risk of all-cause mortality was lower in DPP-4 inhibitor users (HR 0.67, 95% CI 0.64 to 0.70), combination of MI and stroke (HR 0.81, 95% CI 0.76 to 0.87), MI (HR 0.80, 95% CI 0.71 to 0.89) and ischaemic stroke (HR 0.83, 95% CI 0.76 to 0.89) than in non-users. Notably, the risk of hospitalisation for HF did not differ significantly between groups. The results were similar after accounting for death as a competing risk. CONCLUSIONS: In this nationwide T2DM cohort, the risks of mortality and the combination of MI and ischaemic stroke were lower for patients receiving DPP-4 inhibitors than for those who did not receive such treatment. DPP-4 inhibitor use was not associated with a higher risk of hospitalisation for HF even in patients with pre-existing HF.