Our understanding of the evolution of microbial pathogens has been advanced by the discovery of "islands" of DNA that differ from core genomes and contain determinants of virulence. The acquisition of genomic islands (GIs) by horizontal gene transfer (HGT) is thought to have played a major role in microbial evolution. There are, however, few practical demonstrations of the acquisition of genes that control virulence, and, significantly, all have been achieved outside the animal or plant host. Loss of a GI from the bean pathogen Pseudomonas syringae pv. phaseolicola (Pph) is driven by exposure to the stress imposed by the plant's resistance response. Here, we show that the complete episomal island, which carries pathogenicity genes including the effector avrPphB, transfers between strains of Pph by transformation in planta and inserts at a specific att site in the genome of the recipient. Our results show that the evolution of bacterial pathogens by HGT may be achieved via transformation, the simplest mechanism of DNA exchange. This process is activated by exposure to plant defenses, when the pathogen is in greatest need of acquiring new genetic traits to alleviate the antimicrobial stress imposed by plant innate immunity.