In vivo coevolution with pathogens favors costlier, but more protective microbes. (A) Within nonevolving Caenorhabditis elegans hosts, Enterococcus faecalis populations were either coevolved with Staphylococcus aureus or were evolved on their own. This procedure was continued for ten passages (see Materials and Methods for full protocol). (B) Host mortality (cost) due to colonization by coevolved/evolved E. faecalis. Binomial GLM: df = 1, P = 0.0062. (C) Host mortality following exposure to S. aureus exposure alone (magenta) or with either coevolved or evolved E. faecalis (dark or light turquoise, respectively). Quasibinomial GLM: F = 122.34, df = 2, P = 1.044e-08. Post hoc Tukey: S. aureus alone versus with coevolved E. faecalis: P < 0.001; S. aureus alone versus with evolved E. faecalis: P < 0.001. Coevolved E. faecalis versus with evolved E. faecalis: P = 0.005. (D) In vitro population size of S. aureus in colony-forming units per ml (CFU/ml) after coculture with either coevolved or evolved E. faecalis. CFUs/ml were also counted upon the addition of superoxide dismutase and catalase enzymes which remove superoxide and hydrogen peroxide from the media. t-Test, coevolution: control versus SOD&CAT, t = −4.6, df = 8, FDR-adjusted P = 0.003; evolution: control versus SOD&CAT, t = 0.98, df = 8, FDR-adjusted P = 0.35. All experiments were repeated twice and results were combined. Each treatment was replicated five times. *P < 0.05, **P < 0.01, ***P < 0.001. Bar plots show ±2SE.