Sudden cardiac arrest remains a major complication of acute myocardial infarction (AMI) and is frequently related to ventricular fibrillation (VF). Incidence and impact of VF among patients hospitalized for AMI were evaluated. Data from the FAST-MI programme consisting of 5 French nationwide prospective cohort studies between 1995 and 2015 were analysed, totally including 14 423 patients with AMI (66 ± 14 years, 72% males, 59% ST-elevation myocardial infarction). Overall, proportion of patients presenting in-hospital VF decreased from 3.9% in 1995 to 1.8% in 2015 (P < 0.001). One-year mortality decreased from 60.7% to 24.6% (P < 0.001). However, compared with patients who did not develop VF, the over-risk of 1-year mortality associated with VF was stable over time [hazard ratio (HR) 6.78, 95% confidence interval (CI) 5.03–9.14 in 1995 and HR 6.64, 95% CI 4.20–10.49 in 2015, P = 0.52]. This increased mortality in the VF group was mainly related to fatal events occurring prior to hospital discharge, representing 86.2% of 1-year mortality, despite the very low rate of implantable cardioverter defibrillator in the VF group (2.6%). This study demonstrates that in-hospital VF incidence and mortality in the setting of AMI have significantly decreased over the past 20 years. Nevertheless, VF remained steadily associated with approximately a 10-fold increased relative risk of in-hospital mortality, without an impact on post-discharge mortality. Beyond long-term cardiac defibrillation strategy, these results emphasize the need to identify in-hospital interventions to further reduce mortality in VF patients. ClinicalTrials.gov Identifier: NCT00673036, NCT01237418, NCT02566200 In-hospital ventricular fibrillation (VF) incidence and mortality in the setting of acute myocardial infarction have significantly decreased over the past 20 years. Nevertheless, VF remained steadily associated with a ∼10-fold increased relative risk of in-hospital mortality, without an impact on post-discharge mortality. FAST-MI, French registry of acute ST-elevation or non-ST-elevation myocardial infarction; PCI, percutaneous coronary intervention; VF, ventricular fibrillation.