ABSTRACT: Extended-spectrum beta-lactamase (ESBL)-producing Escherichia coli have been reported in natural environments, and may be released through wastewater. In this study, the genetic relationship between ESBL-producing E. coli collected from patient urine samples (n = 45, both hospitalized patients and out-patients) and from environmental water (n = 82, from five locations), during the same time period, was investigated. Three independent water samples were collected from the municipal wastewater treatment plant, both incoming water and treated effluent water; the receiving river and lake; and a bird sanctuary near the lake, on two different occasions. The water was filtered and cultured on selective chromID ESBL agar plates in order to detect and isolate ESBL-producing E. coli. Illumina whole genome sequencing was performed on all bacterial isolates (n = 127). Phylogenetic group B2 was more common among the clinical isolates than the environmental isolates (44.4% vs. 17.1%, p < 0.01) due to a significantly higher prevalence of sequence type (ST) 131 (33.3% vs. 13.4%, p < 0.01). ST131 was, however, one of the most prevalent STs among the environmental isolates. There was no significant difference in diversity between the clinical isolates (DI 0.872 (0.790-0.953)) and the environmental isolates (DI 0.947 (0.920-0.969)). The distribution of ESBL genes was similar: blaCTX-M-15 dominated, followed by blaCTX-M-14 and blaCTX-M-27 in both the clinical (60.0%, 8.9%, and 6.7%) and the environmental isolates (62.2%, 12.2%, and 8.5%). Core genome multi-locus sequence typing showed that five environmental isolates, from incoming wastewater, treated wastewater, Svartån river and Hjälmaren lake, were indistinguishable or closely related (?10 allele differences) to clinical isolates. Isolates of ST131, serotype O25:H4 and fimtype H30, from the environment were as closely related to the clinical isolates as the isolates from different patients were. This study confirms that ESBL-producing E. coli are common in the aquatic environment even in low-endemic regions and suggests that wastewater discharge is an important route for the release of ESBL-producing E. coli into the aquatic environment.