The objective of this study was to characterise the beta-lactamase genes of cephalosporin-resistant Escherichia coli isolated from farm animals in Guangdong Province of China. Of 592 E. coli isolates recovered from farm animals from 2003-2005, 50 (8.4%) showed cephalosporin resistance. Polymerase chain reaction and sequencing analysis showed that 14 isolates (2.4%) from chickens, ducks, pigs and partridges were positive for the bla(CTX-M) gene (10 for bla(CTX-M-14) and 4 for bla(CTX-M-27)). CMY-2 was detected for the first time in mainland China in six E. coli isolates (1.0%) from chickens and goose. Except for one isolate, bla(CTX-M)- and bla(CMY-2)-containing isolates also harboured the bla(TEM-1b) gene. Conjugation experiments demonstrated that the bla(CTX-M) and bla(TEM) genes could be transferred to E. coli DH5alpha. Pulsed-field gel electrophoresis (PFGE) showed that the 14 CTX-M-producing isolates belonged to 12 different types. Two isolates (one from a chicken, the other from a pig) containing CTX-M-14 showed indistinguishable PFGE patterns, indicating clonal dissemination of this strain among animals from different farms. This study describes for the first time the emergence of CTX-M- and CMY-2-producing E. coli among farm animals in China, with the CTX-M-9 group being the predominant extended-spectrum beta-lactamase detected.