Microbes that protect their hosts from pathogens are widespread in nature and are attractive disease control agents. Given that pathogen adaptation to barriers against infection can drive changes in pathogen virulence, defensive microbes' may shape disease severity. Here we show that co-evolving a microbe with host-protective properties (Enterococcus faecalis) and a pathogen (Staphylococcus aureus) within Caenorhabditis elegans hosts drives the evolution of reduced pathogen virulence as a by-product of adaptation to the defensive microbe. Using both genomic and phenotypic analyses, we discover that the production of fewer iron-scavenging siderophores by the pathogen reduces the fitness of the defensive microbe and underpins the decline in pathogen virulence. These data show that defensive microbes can shape the evolution of pathogen virulence and that the mechanism of pathogen resistance can determine the direction of virulence evolution.