Earthworms provide a major potential source of alternative food for polyphagous predators, such as carabid beetles, that are natural enemies of slugs, aphids and other agricultural pests. Non-pest prey may foster larger numbers of natural enemies, which then help to control pests, or alternatively may help to divert the predators away from pest control. An earthworm-specific monoclonal antibody was developed to study carabid–earthworm interactions in the field and assess the role of earthworms as alternative prey. The antibody could identify as little at 7 ng of earthworm protein in an ELISA, and could detect earthworm remains in the foregut of the carabid beetle Pterostichus melanarius for 64 h after consumption. Thirty-six per cent of field-collected beetles contained earthworm remains. Quantities of earthworm proteins in the beetle foreguts were negatively related to total foregut biomass, suggesting that earthworm consumption increased as total prey availability declined. There was also a negative relationship between foregut biomass and beetle numbers, but both quantities and concentrations of earthworm proteins in beetle foreguts were positively related to beetle numbers. This suggests that as beetle activity–density increased, total prey availability declined, or, as prey availability declined, beetles spent more time searching. In these circumstances, beetles fed to a greater extent on earthworms, an acceptable but nonpreferred food item. Earthworms may, therefore, provide an ideal alternative prey for P. melanarius, helping to sustain it when pest numbers are low but allowing it to perform a ‘lying-in-wait’ strategy, ready to switch back to feeding on pests when they become available.