A population-based study was performed to investigate the efficacy of mecillinam treatment of community-acquired urinary tract infections (CA-UTI) caused by extended-spectrum β-lactamase (ESBL) producing Escherichia coli. The study was conducted in South-Eastern Norway. Data from patients with CA-UTI caused by ESBL-producing and non-producing (random controls) E. coli were collected through interviews, questionnaires, medical records and the Norwegian Prescription Database. Treatment failure was defined as a new antibiotic prescription appropriate for UTI prescribed within two weeks after the initial antimicrobial therapy. Multivariable logistic regression analysis was performed to identify treatment agents and patient- or bacterial traits associated with treatment failure. A total of 343 patients (mean age 59) were included, of which 158 (46%) were treated with mecillinam. Eighty-one patients (24%, mean age 54) had infections caused by ESBL producing E. coli, and 41 of these patients (51%) received mecillinam as the primary treatment. Mecillinam treatment failure was observed in 18 (44%) of patients infected by ESBL-producing strains and in 16 (14%) of patients with a CA-UTI caused by ESBL non-producing strains. Multivariable analysis showed that ESBL status (odds ratio (OR) 3.2, 95% confidence interval (CI) 1.3-7.8, p = 0.009) and increased MIC of mecillinam (OR 2.0 for each doubling value of MIC, CI 1.4-3.0, p<0.001) were independently associated with mecillinam treatment failure. This study showed a high rate of mecillinam treatment failure in CA-UTIs caused by ESBL producing E. coli. The high failure rate could not be explained by the increased MIC of mecillinam alone. Further studies addressing the use of mecillinam against ESBL-producing E. coli, with emphasis on optimal dosing and combination therapy with β-lactamase inhibitors, are warranted.