Klebsiella pneumoniae is a gram-negative, encapsulated, and lactose-fermenting bacterium related to hospital-acquired infections that can cause various diseases. The current study aimed to detect the presence of the virulence-associated genes fim H and UDP among multiple drug-resistant K. pneumoniae isolates obtained from different sources using polymerase chain reaction (PCR) to determine their association with antibiotic resistance. Ninety K. pneumoniae isolates were obtained from 210 different clinical samples collected from various sources (urine, sputum, wound swabs, blood, and burns) from patients of both genders in Baghdad hospitals between March 2022 and July 2022. Bacterial identification was based on selective and differential media, followed by seven biochemical tests, the Vitek-2 system, and molecular identification tests were performed using 16S rRNA. The antibiotic susceptibility of isolates to 13 antibiotics was assessed by the disk diffusion method on Mueller–Hinton agar. The results showed that 100% of the isolates were resistant to vancomycin. Otherwise, colistin had the lowest resistance rate (25.55%). The virulence genes fim H and UDP (uge) were detected by multiplex polymerase chain reaction (PCR) in multidrug-resistant (MDR) isolates. The most prevalent gene was fim H (88%) followed by UDP (80%). The virulence genes were highly prevalent among MDR K. pneumoniae isolates. The resistance rate to colistin was 25.55%, making it the most effective antibiotic used in the current study. Vancomycin, on the other hand, had a high resistance value. Multidrug resistant isolates were found to be associated with the presence of virulence genes.