The current study aims to investigate the prevalence of extended-spectrum ß-lactamases (ESBLs) and AmpC β-lactamases in multiple-drug-resistant Escherichia coli (e.g., multidrug-resistant (MDR), extensively drug-resistant (XDR), and pan-drug-resistant (PDR)) collected from hospitalized patients in Baghdad. The results showed that the prevalence of ESBLs among E.coli isolates was high. From the total 113 E.coli isolates, 75 (66.37%) were ESBL-producing, while 38 (33.63%) were non-ESBL-producing. Out of 75 ESBL-positive isolates, 39 (52%) were obtained from females and 36 (48%) from males. Additionally, 43 (57.33%) isolates were collected from urine samples, and the highest production of ESBLs was obtained from the age group 41–60 years (29.33%). Moreover, out of 111 MDR E.coli, 64 (57.66%) exhibited a positive ESBL test, while 47 (42.34%) did not. Out of 24 XDR E.coli isolates, 11 (45.83%) demonstrated positive ESBLs, while 13 (54.17%) showed negative ESBLs. The antimicrobial susceptibility test results showed that positive ESBL E.coli isolates were more drug-resistant than negative ESBL isolates. The positive ESBLs of E.coli exhibited a higher resistance rate to the β-lactam antibiotics and showed a co-resistance to non-β-lactam antibiotics. Phenotypic detection of AmpC β-lactamase by the screening of cefoxitin-resistant isolates revealed that 43 (38.05%) isolates were considered positive for AmpC β-lactamase production. However, the PCR technique gives different results. In conclusion, the prevalence of ESBL and AmpC β-lactamase producing E. coli is rapidly increasing among clinical isolates of MDR, XDR, and possibly PDR E.coli.