In this study, 121 Escherichia coli samples isolated from clinical specimens obtained from Pakistan Institute of Medical Science, Islamabad, Pakistan, were analyzed for extended-spectrum β-lactamases (ESBLs) and AmpC β-lactamases using disk-diffusion assay and polymerase chain reaction. Of the isolates, 78 and 43 were identified as ESBL and AmpC producers, respectively. The highest resistance (89%) was observed against cefotaxime, followed by ciprofloxacin (87.6%) and cefepime (87%). Genetic analysis showed the presence of different class A and class C β-lactamase genes, either alone (44.7%) or in combination (53.6%). CTX-M (57.7%) was the most prevalent among class A, followed by TEM (20.3%) and SHV (15.4%). CIT (including LAT-1 to LAT-4, CMY-2 to CMY-7, and BIL-1) and MOX (including MOX-1, MOX-2, CMY-1, and CMY-8 to CMY-11) family-specific plasmid-mediated AmpC β-lactamases were the most prevalent among these isolates. Our study showed that both class A and class C β-lactamases contributed to cephalosporin resistance in the E. coli isolates, thereby limiting therapeutic options. Co-expression of these enzymes may further hinder the identification of ESBLs, which is a critical step for designing a successful treatment for multidrug-resistant E. coli.