OBJECTIVE To establish a rapid assay to detect enterohemorrhagic Escherichia coli O157 (E. coli O157) and enterohemorrhagic Escherichia coli O104 (E. coli O104) in the legume plants and its products by using the duplex real-time PCR. METHODS Based on part fragments of E. coli O157 specific gene rfbE and E. coli O104 specific gene wzy, primers and Taq-Man probes were designed. Results DNA (Q157): DNA (O104) = 1 : 3, DNA 2 μL, Master Mix 12.5 μL, primers (10 μmol/L) 1 μL,Taq-Man probes( 10 μmol/L) 0.5 μL, ddH2O 25 μL. The two pathogens could be detected in one reaction system, the lowest limit of detection sensitivity was 10(2) CFU/mL(g). CONCLUSION This method is rapid and convenient, with good specificity, high sensitivity. The duplex real-time PCR assay could provide a cost-effective and convenient method for detect foodborne pathogenic bacteria.