Objective To verify the role of proton pump inhibitors (PPI) and nitrofurantoin, which have appeared as novel risk factors for carriage of extended-spectrum β-lactamase (ESBL) -producing Escherichia coli, as risk factors for ESBL E. coli urinary tract infection (UTI). We included known risk factors to ascertain whether our findings are comparable with those of previous studies. Methods Population-based case–control study including 339 cases with community-onset ESBL E. coli UTI in 2007–2012, 3390 non-ESBL E. coli UTI controls and 3390 population controls. We investigated potential risk factors by estimating ORs and 95% CIs adjusting for sex, age and co-morbidity. Results Comparing cases with non-ESBL E. coli UTI, PPI use yielded an OR of 1.6 (95% CI 1.2–2.0) and antibiotic exposure gave an OR of 1.4 (95% CI 1.1–1.8); these were driven by nitrofurantoin (OR 1.8; 95% CI 1.3–2.6) and macrolides (OR 1.7; 95% CI 1.2–2.3). Other risk factors included previous hospitalization with one or two and more than two hospitalizations versus none yielding ORs of 1.9 (95% CI 1.4–2.5) and 4.6 (95% CI 3.2–6.8), recent surgery (OR 2.0; 95% CI 1.5–2.8), renal disease (OR 2.2; 95% CI 1.4–3.4), chronic pulmonary disease (OR 1.4; 95% CI 1.0–2.0) and cancer (OR 1.5; 95% CI 1.1–2.1). Comparing cases with population controls, we found that most risk factors were also risk factors for non-ESBL UTI. Conclusions ESBL E. coli UTI were associated with previous hospitalization and surgery. Nitrofurantoin and macrolides augmented the risk. PPIs had a moderate effect but may be important facilitators of ESBL carriage due to their widespread use.