Data from US have shown a reversal in the improvement of heart failure (HF)-related mortality over the last ~10 years. It is unknown whether these trends generalize to European universal healthcare systems. We assessed temporal trends in (i) HF-related mortality in the overall national population; and (ii) all-cause mortality following an incident HF diagnosis, overall and stratified by ejection fraction (EF), in Sweden between 1997 and 2022. Annual mortality rates with a HF diagnosis as underlying cause were extracted from the Cause of Death Register. All-cause mortality following incident HF was assessed in two HF cohorts derived from the National Patient Register (NPR) and the Swedish HF Registry (SwedeHF). Temporal trends were presented as average annual percentage change (AAPC). Between 1997 and 2022, age-adjusted HF-related mortality in the general population declined from 33.4 to 23.8 per 100 000 individuals (AAPC -2.15%, p < 0.001). In the HF cohort from NPR (n = 423 092), all-cause mortality at 1, 3, and 5 years following a first diagnosis of HF was 25%, 46%, and 58%, respectively, in 2022; 1-year mortality declined (AAPC -1.10%, p < 0.001) over time regardless of age or sex. In SwedeHF (n = 63 753), the decline in 1-year mortality was less steep with increasing EF (AAPC -2.64%, p < 0.001; -2.30%, p = 0.062; and -2.16%, p = 0.032 in EF <40%, 40-49%, and ≥50%, respectively). Heart failure-related mortality has declined over the last ~25 years in Sweden. All-cause mortality in patients with HF has also declined, more in HF with reduced than preserved EF, mirroring the different availability of life-saving treatments across the EF spectrum.