Bacterial growth and virulence often depends upon the cooperative release of extracellular factors excreted in response to quorum sensing (QS). We carried out an in vivo selection experiment in mice to examine how QS evolves in response to variation in relatedness (strain diversity), and the consequences for virulence. We started our experiment with two bacterial strains: a wild-type that both produces and responds to QS signal molecules, and a lasR (signal-blind) mutant that does not release extracellular factors in response to signal. We found that: (i) QS leads to greater growth within hosts; (ii) high relatedness favours the QS wild-type; and (iii) low relatedness favours the lasR mutant. Relatedness matters in our experiment because, at relatively low relatedness, the lasR mutant is able to exploit the extracellular factors produced by the cells that respond to QS, and hence increase in frequency. Furthermore, our results suggest that because a higher relatedness favours cooperative QS, and hence leads to higher growth, this will also lead to a higher virulence, giving a relationship between relatedness and virulence that is in the opposite direction to that usually predicted by virulence theory.