Aims New-onset atrial fibrillation (NOAF) complicating acute myocardial infarction (AMI) has been associated with poor survival, but the clinical implication of NOAF on heart failure (HF) is still not well characterized. We aimed to investigate the relationship between NOAF complicating AMI and HF hospitalization. Methods and results Adult AMI patients identified in the New-Onset Atrial Fibrillation Complicating Acute Myocardial Infarction in Shanghai registry who, discharged alive, had complete echocardiography and follow-up data from February 2014 to March 2018 were included. Patients were divided according to the presence of NOAF. The outcome measures were HF hospitalization and death during the observational period (until 10 April 2019). Cox proportional hazard models were performed in the whole population and propensity score-matched (PSM) cohort to assess the adjusted hazard ratio (HR) and 95% confidence interval (CI). Overall, 2075 patients (mean age: 65.2 ± 12.3 years, 77.3% were men) with AMI were analysed, of whom 228 (11.0%) developed NOAF. Advanced age, admission HF (Killip II-IV), impaired renal function, decreased left ventricular ejection fraction, increased heart rate, and left atrial enlargement were independent predictors of NOAF. Over a median observational period of 2.7 years, the annual incidence rates of HF hospitalization were 18.4% and 2.8% for patients with NOAF and sinus rhythm, respectively. After adjustment for confounders, NOAF was significantly associated with HF hospitalization (HR: 3.14, 95% CI: 2.30-4.28, P < 0.001). Similar results were obtained when accounting for the competing risk of all-cause death (subdistribution HR: 3.06, 95% CI: 2.18-4.30, P < 0.001) or from the PSM cohort (HR: 2.82, 95% CI: 1.99-4.00, P < 0.001). Patients with persistent NOAF (HR: 5.81, 95% CI: 3.59-9.41) were at significantly higher risk of HF hospitalization when compared with those with transient one (HR: 2.61, 95% CI: 1.84-3.70, P interaction = 0.008). Although post-MI NOAF was significantly related to cardiovascular death (annual incidence rates for NOAF and sinus rhythm were 9.4% and 2.3%, respectively; HR: 1.97, 95% CI: 1.36-2.85, P < 0.001), such an association was attenuated when HF hospitalization (modelled as a time-varying covariate) and antithrombotic treatment were adjusted (HR: 1.37, 95% CI: 0.92-2.02, P = 0.121). Conclusions In patients with AMI, NOAF is strongly associated with an increased long-term risk of HF hospitalization. Our findings suggest that strengthened secondary prevention of HF should be considered in this high-risk population.