Infections caused by extended-spectrum β-lactamases (ESBLs) producing bacteria, including Klebsiella pneumoniae have increasingly subjected to therapeutic limitations and patients with these infections are at high risk for treatment failure, long hospital stays, high health care costs, and high mortality. The aim of this study was to screen the prevalence of the bla TEM, bla CTX-M and bla SHV ESBL genes in K. pneumoniae strains isolated from nosocomial urinary tract infections (UTIs). During the March 2016 to December 2017, one hundred isolates of K. pneumoniae were collected from urine specimens of patients suffering from nosocomial UTI referred to Khatam Al-Anbia hospital in Shahrud, north-central Iran. All isolates were identified by standard bacteriological tests. The pattern of antibiotic susceptibility was determined according to the CLSI guidelines. The presence of the ESBLs was investigated using the double-disc synergy test (DDST). Polymerase chain reaction technique was used to detect the bla TEM, bla CTX-M and bla SHV genes in DDST positive isolates. Most isolates showed remarkable resistance to tested antibiotics with highest rate against nitrofurantoin (75%) and trimethoprim/sulfamethoxazole (65%). The imipenem was the most effective antibiotic against K. pneumoniae isolates. ESBL phenotype was detected in 50 (50%) of isolates. The prevalence of bla TEM, bla CTX-M and bla SHV genes among 50 ESBLs-positive isolates was 25 (50%), 15 (30%) and 35 (70%) respectively. The bla TEM and bla SHV genes were seen in 25 isolates (50%) simultaneously. The findings of this study indicated the 50% frequency rate of ESBL-producing K. pneumoniae in our geographic region. Since the treatment of infections caused by this bacterium is associated with many limitations, this high prevalence is a warning sign to adopt new control policies to prevent further spread of this microorganism.