Bacteria can repurpose their own bacteriophage viruses (phage) to kill competing bacteria. Phage-derived elements are frequently strain specific in their killing activity, although there is limited evidence that this specificity drives bacterial population dynamics. Here, we identified intact phage and their derived elements in a metapopulation of wild plant-associated Pseudomonas genomes. We discovered that the most abundant viral cluster encodes a phage remnant resembling a phage tail called a tailocin, which bacteria have co-opted to kill bacterial competitors. Each pathogenic Pseudomonas strain carries one of a few distinct tailocin variants that target the variable polysaccharides in the outer membrane of co-occurring pathogenic Pseudomonas strains. Analysis of herbarium samples from the past 170 years revealed that the same tailocin and bacterial receptor variants have persisted in Pseudomonas populations. These results suggest that tailocin genetic diversity can be mined to develop targeted "tailocin cocktails" for microbial control.