The impact of community complexity on pairwise coevolutionary dynamics is theoretically dependent on the extent to which species evolve generalised or specialised adaptations to the multiple species they interact with. Here, we show that the bacteria Pseudomonas fluorescens diversifies into defence specialists, when coevolved simultaneously with a virus and a predatory protist, as a result of fitness trade-offs between defences against the two enemies. Strong bacteria–virus pairwise coevolution persisted, despite strong protist-imposed selection. However, the arms race dynamic (escalation of host resistance and parasite infectivity ranges) associated with bacteria–virus coevolution broke down to a greater extent in the presence of the protist, presumably through the elevated genetic and demographic costs of increased bacteria resistance ranges. These findings suggest that strong pairwise coevolution can persist even in complex communities, when conflicting selection leads to evolutionary diversification of different defence strategies.