We studied factors that affect prey selection by a generalist predator that opportunistically attacks prey species, and the associated inter- and intra-specific responses of prey to this type of predation. Our model system was a guild of ground-foraging birds that are preyed upon by magpies ( Pica pica) during the breeding season. We found that magpies attacked up to 12 species during three consecutive breeding seasons. The overall capture success was estimated to be 4.9%. Magpies tended to attack from the air, targeting solitary prey, either on the ground or flying. Inter-specific prey responses to the risk of magpie predation included a reduction in the mean number of species occupying a foraging patch when magpies were present and a decrease in the distance between heterospecific neighbours. Intra-specific responses to magpie predation varied between species that were subject to different attack rates. Preferentially attacked prey enhanced their risk responses (increase in scanning time and scanning rate in the presence of magpies) relative to those species attacked in proportion to their abundance (increase only in scanning rate with magpies). Species attacked infrequently, relative to their abundance, showed no antipredator response. The probability of being attacked, rather than mortality rate, appears to be the factor to which prey species respond.