While predators and parasites are known for their effects on bacterial population biology, their impact on the dynamics of bacterial social evolution remains largely unclear. Siderophores are iron-chelating molecules that are key to the survival of certain bacterial species in iron-limited environments, but their production can be subject to cheating by non-producing genotypes. In a selection experiment conducted over approximately 20 bacterial generations and involving 140 populations of the pathogenic bacterium Pseudomonas aeruginosa PAO1, we assessed the impact of a lytic phage on competition between siderophore producers and non-producers. We show that the presence of lytic phages favours the non-producing genotype in competition, regardless of whether iron use relies on siderophores. Interestingly, phage pressure resulted in higher siderophore production, which constitutes a cost to the producers and may explain why they were outcompeted by nonproducers. By the end of the experiment, however, cheating load reduced the fitness of mixed populations relative to producer monocultures, and only monocultures of producers managed to grow in the presence of phage in situations where siderophores were necessary to access iron. These results suggest that public goods production may be modulated in the presence of natural enemies with consequences for the evolution of social strategies.