Klebsiella pneumoniae is a pathogen relevant to hospital acquired and community acquired such as urinary tract infections, pneumonia, and wound and burn. It has high levels of antibiotic resistance and capability to produce biofilm. This study included comparing among six antibiotic resistance patterns for the hospital and community acquired infections, and detected biofilm gene (mrkA). Clinical samples were collected from Teach Bagubah Hospital, Al-Batool Maternity and Children Teaching Hospital, and private laboratories in Baqubah/Diyala, Iraq.To investigate antibiotics susceptibility, the Kirby-Bauer disk diffusion method was used to compare between community acquired isolates and hospital acquired isolates. Hospital acquired of K. pneumoniae were less susceptible than community acquired of K. pneumoniae isolates.Both isolates community acquired and hospital acquired were high rates of resistance for βlactam/β -lactamase (Amoxicillin-clavulanate and Ticarcillin-clavulante). Screening and confirmation based on ESBL chromogenic agar are more sensitive than ESBL producers of the double disk synergy test, which were 30% and 60% produce-ESBLs in nosocomial acquired, and 20% and 40% in community acquired, respectively. The results of gel electrophoresis for PCR product using specific primers for mrkA gene prevalence were 83.33% and 66.6% in