We aimed to investigate temporal trends in all-cause mortality, heart failure (HF) hospitalisation, and stroke from 1997 to 2018 in patients diagnosed with both HF and atrial fibrillation (AF). From Danish nationwide registers, we identified 152059 patients with new-onset HF between 1997 and 2018. Patients were grouped according to year of new-onset HF and AF-status: Prevalent AF (n=34734), New-onset AF (n=12691), and No AF (n=104634). Median age decreased from 76 to 73 years between 1997 and 2018. The proportion of patients with prevalent or new-onset AF increased from 24.7% (n=9256) to 35.8% (n=14970). Five-year risk of all-cause mortality went from 69.1% (CI: 67.9%-70.2%) to 51.3% (CI: 49.9%-52.7%), 62.3% (CI: 60.5%-64.4%) to 43.0% (CI: 40.5%-45.5%), and 61.9% (CI: 61.3%-62.4%) to 36.7% (CI: 35.9%-37.6%) for the Prevalent AF, New-onset AF and No AF-group, respectively. Minimal changes were observed in the risk of HF-hospitalisation. Five-year stroke risk decreased from 8.5% (CI: 7.8%-9.1%) to 5.0% (CI: 4.4%-5.5%) for the prevalent AF group, 8.2% (CI: 7.2%-9.2%) to 4.6% (CI: 3.7%-5.5%) for new-onset AF, and 6.3% (CI: 6.1%-6.6%) to 4.9% (CI: 4.6%-5.3%) for the No AF group. Simultaneously, anticoagulant therapy increased for patients with prevalent (from 42.7% to 93.1%) and new-onset AF (from 41.9% to 92.5%). From 1997 to 2018, we observed an increase in patients with HF and co-existing AF. Mortality decreased for all patients, regardless of AF-status. Anticoagulation therapy increased, and stroke risk for patients with AF was reduced to a similar level as patients without AF in 2013-2018.