Objectives To measure the effect of a voluntary ban on cephalosporin usage in the Danish pig production on the prevalence of extended-spectrum cephalosporinase (ESC)-producing Escherichia coli in pigs and pork.Methods Data on cephalosporin consumption were obtained from the VetStat database. For detection of ESC-producing E. coli, three sampling types were included: at slaughter, caecal samples were collected from pigs in 2009 and 2010 (June) before and in two periods (2010 and 2011) after a voluntary ban on cephalosporins was effected (July 2010); at farm level, pools of five stool samples from different pigsties were collected in 2010 and in 2011; and samples from pork were collected randomly at retail stores and outlets from 2009 to 2011. ESC-producing E. coli was isolated after selective enrichment in MacConkey broth with 1 mg/L ceftriaxone. ESC genes were detected using PCR, microtube array and sequencing.Results From July 2010 the consumption of cephalosporins approximated zero. The occurrence of ESC-producing E. coli in pigs at slaughter was not significantly different (P = 0.7) between 2009 [10.8% (85/786)] and 2010 [11.8% (48/407)], but in 2011 the occurrence [3.6% (28/777)] decreased significantly (P <0.001). A significant decrease (P = 0.002) in occurrence of ESC-producing E. coli at pig farm level from 2010 [11% (11/99)] to 2011 (0/78) was also observed. The blaCTX-M-1 gene was most often detected (63%), but blaCTX-M-14 and blaCTX-M-15 were also found. Occurrence in pork was between 1.3% and 0.9%.Conclusions The discontinuation of an already low use of cephalosporins in pig production has significantly reduced the occurrence of ESC-producing E. coli.