Aims: Use of sodium–glucose co-transporter 2 inhibitors (SGLT2i) in real-world heart failure (HF) is poorly characterised. In contemporary patients with HF and type 2 diabetes mellitus (T2DM) we assessed over time SGLT2i use, clinical characteristics and outcomes associated with SGLT2i use. Methods and results: Type 2 diabetes patients enrolled in the Swedish HF Registry between 2016–2018 were considered. We performed multivariable logistic regression models to assess the independent predictors of SGLT2i use and Cox regression models in a 1:3 propensity score-matched cohort and relevant subgroups to investigate the association between SGLT2i use and outcomes. Of 6805 eligible HF patients with T2DM, 376 (5.5%) received SGLT2i, whose use increased over time with 12% of patients on treatment at the end of 2018. Independent predictors of SGLT2i use were younger age, HF specialty care, ischaemic heart disease, preserved kidney function, and absence of anaemia. Over a median follow-up of 256 days, SGLT2i use was associated with a 30% lower risk of cardiovascular (CV) death/first HF hospitalisation (hazard ratio 0.70, 95% confidence interval 0.52–0.95), which was consistent regardless of ejection fraction, background metformin treatment and kidney function. SGLT2i use was also associated with a lower risk of all-cause and CV death, HF and CV hospitalisation, and CV death/myocardial infarction/stroke. Conclusion: In a contemporary HF cohort with T2DM, SGLT2i use increased over time, was more common with specialist care, younger age, ischaemic heart disease, and preserved renal function, and was associated with lower mortality and morbidity.