Aim: Ileal pouch–anal anastomosis is a procedure offered to patients with ulcerative colitis who opt for restoration of bowel continuity. The aim of this study was to determine the risk of pouch failure and ascertain the risk factors associated with failure. Method: The study included 1991 patients with ulcerative colitis who underwent ileal pouch–anal anastomosis in Denmark in the period 1980–2013. Pouch failure was defined as excision of the pouch or presence of an unreversed stoma within 1 year after its creation. We used Cox proportional hazards regression to explore the association between pouch failure and age, gender, synchronous colectomy, primary faecal diversion, annual hospital volume (very low, 1–5 cases per year; low, 6–10; intermediate 11–20; high > 20), calendar year, laparoscopy and primary sclerosing cholangitis. Results: Over a median 11.4 years, 295 failures occurred, corresponding to 5-, 10- and 20-year cumulative risks of 9.1%, 12.1% and 18.2%, respectively. The risk of failure was higher for women [adjusted hazard ratio (aHR) 1.39, 95% CI 1.10–1.75]. Primary non-diversion (aHR 1.63, 95% CI 1.11–2.41) and a low hospital volume (aHR, very low volume vs high volume 2.30, 95% CI 1.26–4.20) were also associated with a higher risk of failure. The risk of failure was not associated with calendar year, primary sclerosing cholangitis, synchronous colectomy or laparoscopy. Conclusion: In a cohort of patients from Denmark (where pouch surgery is centralized) with ulcerative colitis and ileal pouch–anal anastomosis, women had a higher risk of pouch failure. Of modifiable factors, low hospital volume and non-diversion were associated with a higher risk of pouch failure.