Background: Klebsiella pneumoniae as an opportunistic pathogen can be the cause of a range of nosocomial and community - acquired infections. Many virulence factors help these bacteria overcome an immune system and cause various diseases. K1 and K2 capsular antigens, also magA, wcaG, and rmpA are well - known K. pneumoniae virulence factors. Klebsiella pneumoniae has been revealed to have the ability to acquire resistance to many antibiotics, which cause treatment failure. Objectives: This study aimed at determining the prevalence of magA, wcaG, rmpA, Capsular type K1, Capsular type K2, TEM, and SHV in K. pneumoniae isolates. Methods: A total of 173 non - duplicate K. pneumoniae isolates were collected from two different hospitals in Semnan, Iran, from urine specimens. Klebsiella pneumoniae was identified by conventional bacteriological tests. Disk diffusion test was performed according to the guidelines of the Clinical and Laboratory Standards Institute (CLSI). Detection of virulence factors, TEM, and SHV gene was performed by specific primers. Results: Frequency of virulence factors was as follow: capsular type K2: 32.9%, rmpA: 20.2%, capsular type K1: 6.9%, and wcaG: 16.2%. Also, the SHV and TEM were observed in 46.8% and 33.5%, respectively. Antibiotics resistance rates were as follow, imipenem: 7.5%, ciprofloxacin: 16.1%, levofloxacin: 17.3%, amoxicillin - clavulanic acid: 30%, trimethoprim - sulfamethoxazole: 32.9%, cefepime: 34.1%, nitrofurantoin: 35.8%, amikacin: 36.4%, aztreonam: 39.3%, ceftazidime: 42.7%. Conclusions: Frequency of some virulence factors including capsular type K2, rmpA, wcaG, and also resistant rate to imipenem, amikacin, and ceftazidime were significantly higher than similar studies. Presence of virulence factors accompanied by drug resistance should make bacteria an infectious agent and lead to treatment failure.