Abstract Background Given the many advances in treating heart failure (HF) and atrial fibrillation (AF) separately over the past decades, it remains unclear how the prognosis of patients diagnosed with both conditions has changed over time. Purpose We aimed to investigate the temporal trends in all-cause mortality, HF hospitalisation, and stroke from 1997 to 2018 in patients diagnosed with both HF and AF. Methods From Danish nationwide registries, we identified 152,059 patients with a first-time HF-diagnosis from 1997 to 2018. Patients were categorised into groups based on their AF status: prevalent AF (n=34,734), new-onset AF (n=12,691), and absence of AF (n=104,634). Patients were further subdivided into four year groups (1997-2001, 2002-2006, 2007-2012, 2013-2018), based on the year of HF onset. The primary outcome of interest was the absolute five-year risk of all-cause mortality, and key secondary outcomes were HF hospitalisation and stroke, investigated using the Aalen-Johansen estimator, accounting for competing risk of death. Results Between 1997 and 2018 the proportion of patients with new-onset HF and prevalent AF increased from 17.0% (n = 6,372) to 27.7% (n = 11,569), while those with concurrent new-onset AF increased from 7.7% (n = 2,884) to 8.1% (n = 3401). Contrary, the proportion of patients decreased among those with no AF from 75.3% (n = 28,235) to 64.2% (n = 26,850). The five-year risk of all-cause mortality decreased from 69.1% (95% CI): 67.9%-70.2%) to 51.3% (49.9%-52.7%), 62.3% (60.5%-64.4%) to 43.0% (40.5%-45.5%), and 61.9% (61.3%-62.4%) to 36.7% (35.9%-37.6%) for the prevalent AF, new-onset AF, and no AF group, respectively (Figure 1). The five-year risk of HF hospitalisation went from 33.3% (32.1%-34.4%) to 30.3% (29.2%-31.4%) in the prevalent AF group, from 25.8% (24.2%-27.4%) to 29.6% (27.7%-31.5%) in the new-onset AF group, and from 28.4% (27.8%-28.9%) to 28.0% (27.2%-28.6%) in the no AF group. The five-year risk of stroke decreased from 8.5% (7.8%-9.1%) to 5.0% (4.4%-5.5%) in the prevalent AF group, 8.2% (7.2%-9.2%) to 4.6% (3.7%-5.5%) in the new-onset AF group, and 6.3% (6.1%-6.6%) to 4.9% (4.6%-5.3%) in the no AF group (Figure 2). Simultaneously, the proportion of patients prescribed anticoagulant therapy within 90 days after HF onset increased from 42.7% to 93.1% in patients with prevalent AF and 41.9% to 92.5% in patients with new-onset AF. Conclusion From 1997 to 2018, we observed an increase in patients with HF and coexisting AF. The five-year risk of mortality and stroke decreased across all patient groups regardless of AF-status. Additionally, prescriptions of anticoagulation therapy increased, and stroke risk in patients with HF and AF was reduced to similar levels as patients with HF without AF at the end of the study period.Figure 1 - Mortality in HF patientsFigure 2 - Stroke risk in HF patients