1. Mutualistic and antagonistic interactions, although often studied independently, may affect each other, and food web dynamics are likely to be determined by the two processes working in concert.
2. The structure, and hence dynamics, of food webs depends on the relative abundances of generalist and specialist feeding guilds. Secondary parasitoids of aphids can be divided into two feeding guilds: (i) the more specialised endoparasitoids, which attack the primary parasitoid larvae in the still living aphid, and (ii) the generalist ectoparasitoids, which attack the pre-pupa of the primary or secondary parasitoid in the mummified aphid.
3. We studied the effect of an ant–aphid mutualism on the relative abundance of these two functional groups of secondary parasitoids. We hypothesised that generalists will be negatively affected by the presence of ants, thus leading to a greater dominance of specialists.
4. We manipulated the access of ants (Lasius niger) to aphid colonies in which we placed parasitised aphids. Aphid mummies were collected and reared to determine the levels of endo- and ecto-secondary parasitism.
5. When aphids were attended by L. niger the proportion of secondary parasitism by ectoparasitoids dropped from 26 to 8% of the total number of parasitised aphids, with Pachyneuron aphidis most strongly affected, while endoparasitoids as a group did not respond. However, among these Syrphophagus mamitus profited from ant attendance becoming the dominant secondary parasitoid, while parasitisation rates of Alloxysta and Phaenoglyphis declined.
6. The shift to S. mamitus as dominant secondary parasitoid in ant-attended aphid colonies is likely due to the behavioural plasticity of this species in response to ant aggression, and a release from tertiary parasitism by generalist ectoparasitoids.
7. The reduction of secondary parasitism by generalist ectoparasitoids reduces the potential for apparent competition among primary parasitoids with consequences for the dynamics of the wider food web.