Abstract Background Evidence of the effectiveness of β-blockers in heart failure (HF) and atrial fibrillation (AF) in a contemporary cohort is controversial. This study investigated the association between the use of β-blockers and prognosis in outpatients across a broad spectrum of HF with AF. Methods Patients hospitalized with the first episode of acute HF were identified from the National Database of Health Insurance Claims and Specific Health Checkups of Japan between 2014 and 2021. Associations of β-blocker use at discharge and prognosis were compared by propensity score matching among the AF or non-AF group. A multilevel mixed-effects survival model was used with hazard ratio (HR) and 95% confidence interval (CI). Results Among 428,650 patients discharged with HF in 4,433 hospitals, 175,174 (40.9%) were ≥85 years old, 151,873 (35.4%) had complicated AF, and 236,457 (55.2%) were β-blocker users. In a matched AF group, β-blocker use was associated with a lower composite outcome of all-cause mortality or HF rehospitalization (HR [95% CI], 0.95 [0.93–0.97]). A similar result was obtained in a matched non-AF group (0.95 [0.94–0.96]). In addition, the HRs in patients aged ≥85 years and female patients were 1.00 [0.98–1.02] and 1.01 [0.98–1.03] in the AF group and 1.03 [1.01–1.05] and 0.98 [0.97–1.00] in the non-AF group, respectively (Figure). Conclusions The favorable prognostic associations of β-blocker use were observed regardless of AF in outpatients across a broad spectrum of HF in a superaged society. However, β-blocker use may not be effective in older or female patients.