The aim of the study was to characterize plasmids that harbour blaESBL genes and their genetic environment in Escherichia coli and Klebsiella pneumoniae clones circulating in Spain. The incompatibility group of plasmids within 58 strains harbouring blaCTX-M (n=45) and blaSHV (n=15) genes was determined by rep-typing-PCR and hybridization. The blaESBL genetic environment was determined by PCR and sequencing. The blaCTX-M-9 genes (n=14) were linked to In60 located in IncI1 (50%) or IncHI2 plasmids (28%). All blaCTX-M-14 genes (n=13) were flanked by ISEcp1 and IS903 and 12 were associated with IncK plasmids. One of two blaCTX-M-10 genes was present in an IncK plasmid, but both genes were linked to a phage-related element. Five of seven blaCTX-M-1 (71%), all three blaCTX-M-32 and one of two blaCTX-M-3 genes were linked to IncN plasmids. The other blaCTX-M-3 gene was linked to IncA/C and the remaining two blaCTX-M-1 genes to IncFII plasmids. Three blaCTX-M-15 genes were associated with IncF (repFIA) and one with IncFII plasmids. All these genes from blaCTX-M group-1 showed the ISEcp1 upstream truncated by different insertion sequences. Forty-three percent of blaSHV-12 genes (n=14) were located in IncI1 plasmids, all flanked by the IS26 and DEOR region. The only detected blaSHV-5 gene was located in an IncFII plasmid and flanked by recF and DEOR regions. A diversity of the plasmid incompatibility groups that harbour blaESBL genes was observed, except for the blaCTX-M-14 gene. Moreover, a high variability was confirmed in the genetic environment of these genes as a result of insertion and deletion events.