The extended-spectrum b-lactamase (ESBL) producer bacteria until now were mostly identified in hospital environment. The aim of this study was to analyze the prevalence of ESBL-producing gut flora and distribution of ESBL encoding genes between hospitalized patient in Tropical Wards of Dr. Soetomo Hospital and patient from a primary health centre (PHC) as community environment in Surabaya. Thiry rectal swab samples from hospital of Dr. Soetomo patients and from PHC (60 samples in total) were collected for this study. Samples were screened in MacConkey agar supplemented with 2 mg/L of cefotaxim, incubated at 37ÂșC for 24 hours. Then the growing colony were confirmed with Disk Diffusion Synergy test (DDST) for diagnosis of ESBL producer. The identified ESBL producers were then identified the bacteria species by biochemical method. ESBL gene were detected by PCR with specific primers. The results showed that there was not difference of positif nuber of ESBL-producing bacteria gut floral between patients of Dr.Soetomo Hospital, 25/30 (83.3%) and PHC, 11/30 (36.7%) (p=1). The pattern of ESBL gene distributions among samples from hospital showed that SHV was 12%, TEM was 36%, and CTX-M was 80%, and from PHC were SHV 18.2%, TEM 27,3% and CTX-M 81,8%. Statistical analysis showed that the pattern was not significantly different among hospitals and PHC samples as shown by SHV gene (p=0,631), TEM (p= 0.715), and CTX -M (p=1). From each ESBL gene, the dominant genes that found producing ESBL were the CTX-M genes followed by TEM and SHV genes. The prevalence of ESBL producersin intestinal flora of both the hospital (83,3%) and the PHC (36,7%) was very high. There was not significant difference between the prevalence of ESBL producer in gut flora of hospitalized patients compared to PHC. There was found other patterns of ESBL gene combinations in the hospital of SHV+CTX-M genes, TEM+CTX-M, SHV+TEM+CTX-M genes and PHC, the combination pattern of SHV+CTX-M, TEM+CTX-M.