Klebsiella pneumoniae is among the most important causes of urinary tract infection (UTI). The aim of this study was to investigate the prevalence and correlation of antibiotic resistance with virulence characteristics and genetic diversity in K. pneumoniae isolated from UTIs in Iran. Phenotypic tests and antibiotic susceptibility were carried out on the isolates. Detection of the virulence and extendedspectrum β-lactamase (ESBL) genes was performed by polymerase chain reaction. Pulsed-field gel electrophoresis (PFGE) was used for exploring the genomic relatedness. Hemolysin, biofilm, and hypermucoviscosity formation were observed in 87.1%, 86.4%, and 12.1% of isolates, respectively. The antibiotic resistance rate of K. pneumoniae isolates ranged from 12.1% for meropenem to 100% for amoxicillin. The prevalence of virulence genes ranged from 1.4% for cnf-1 to 100% for mrkD, fimH, kpn, and entB genes. In this study, 91.7%, 33.3%, and 4.2% of phenotypically ESBL-producers were positive for bla CTX-M , bla TEM , and bla SHV genes, respectively. An association was observed between the presence of traT, fyuA, or cnf-1 genes with antibiotic resistance. Two clone types were obtained by PFGE that indicate different K. pneumoniae clones in community-and hospital-acquired UTIs. The findings of this study are valuable in development of treatment strategies against UTIs in Iran.