Extended-spectrum β-lactamases (ESβLs) pose a serious problem in the treatment of urinary tract infections (UTIs). The ESβL-producing organism is an expanding global health problem. Therefore, screening for ESβL, detection of their drug-resistance pattern, and molecular characterization should be a continuous process. The present study was performed to determine the antibiotic resistance profile and the genetic characterization of ESβL isolates from hospital- and community-acquired UTIs. Two hundred fifty Enterobacteriaceae isolates were obtained from urine samples of outpatient clinic attendants and hospitalized patients at Kasr Al-Aini Hospital. By phenotypic screening tests, 100 ESβL isolates were detected among the studied groups. Furthermore, detection of beta-lactamase (bla) cefotaxime (CTX)-M, sulfhydryl variable, and temoneira ESβL genes was investigated by polymerase chain reaction. A subset of 25 CTX-M-positive isolates was further identified by gene sequencing technology. Among the 100 ESβL isolates, 66% were Escherichia coli and 34% were Klebsiella spp. There was no statistical difference in the prevalence of ESβL Enterobacteriaceae in community-acquired versus hospital-acquired UTIs. The susceptibility of all ESβL isolates to carbapenems was the most prevalent finding. In addition, all ESβL E. coli isolates were susceptible to fosfomycin, whereas all community-acquired ESβL isolates were susceptible to nitrofurantoin. A total of 98% of the ESβL isolates harbored bla-CTX-M genes, with CTX-M-15 being the most prevalent. It could be concluded that ESβL production is present at a high rate among Egyptian patients with hospital- and community-acquired UTI. The high prevalence of bla-CTX-M may suggest it as a candidate for molecular screening of ESβL.