OBJECTIVES: To assess the impact of ESBL production on mortality and length of hospital stay (LOS) of community-onset infections due to Escherichia coli or Klebsiella pneumoniae. METHODS: A population-based cohort study including all adult patients hospitalized with a first-time community-onset E. coli or K. pneumoniae bacteraemia or urinary tract infection in the North Denmark Region between 2007 and 2017. For each bacterial agent, we computed 1 year Kaplan-Meier survival curves and cumulative incidence functions of LOS, and by use of Cox proportional hazard regression we computed HRs as estimates of 30 day and 1 year mortality rate ratios (MRRs) and LOS among patients with and without ESBL-producing infections. RESULTS: We included 24 518 cases (among 22350 unique patients), of whom 1018 (4.2%) were infected by an ESBL-producing bacterium. The 30 day cumulative mortality and adjusted MRR (aMRR) in patients with and without ESBL-producing isolates was as follows: E. coli bacteraemia (n = 3831), 15.8% versus 14.0%, aMRR = 1.01 (95% CI = 0.70-1.45); E. coli urinary tract infection (n = 17151), 9.5% versus 8.7%, aMRR = 0.97 (95% CI = 0.75-1.26); K. pneumoniae bacteraemia (n = 734), 0% versus 17.2%, aMRR = not applicable; and K. pneumoniae urinary tract infection (n = 2802), 13.8% versus 10.7%, aMRR = 1.13 (95% CI = 0.73-1.75). The 1 year aMRR remained roughly unchanged. ESBL-producing E. coli bacteraemia was associated with an increased LOS compared with non-ESBL production. CONCLUSIONS: ESBL production was not associated with an increased short- or long-term mortality in community-onset infections due to E. coli or K. pneumoniae, yet ESBL-producing E. coli bacteraemia was associated with an increased LOS.