BACKGROUND: Inflammatory bowel disease (IBD) has been linked to adverse cardiovascular events, but a relation to heart failure (HF) is uncertain. We investigated the IBD-associated risk of HF in a nationwide setting. METHODS AND RESULTS: A total of 5 436 647 Danish citizens, with no history of IBD or HF, were included on January 1, 1997, and followed up until first hospitalization for HF, death, or December 31, 2011. Of these subjects, 23 681 developed IBD for which disease activity was determined continuously throughout the study. The risk of hospitalization for HF was estimated with a Poisson regression model adjusting for comorbidity and cardiovascular pharmacotherapy as time-dependent covariates. During a mean follow-up of 11.8 years in the reference population and 6.4 years in the IBD group, hospitalization for HF occurred in 553 subjects with IBD and 171 405 in the reference population. Patients with IBD had a 37% increased risk of hospitalization for HF (incidence rate ratio, 1.37; 95% confidence interval, 1.26-1.49) compared with the reference population. IBD activity-specific analyses showed markedly increased risk of HF hospitalization during flares (incidence rate ratio, 2.54; 95% confidence interval, 2.13-3.04) and persistent activity (incidence rate ratio, 2.73; 95% confidence interval, 2.25-3.33) but not in IBD remission (incidence rate ratio, 1.04; 95% confidence interval, 0.94-1.16). CONCLUSIONS: In a nationwide cohort, IBD was associated with an increased risk of hospitalization for HF, and this risk was strongly correlated to periods of active disease. The mechanisms underlying this finding warrant further studies.