Herbivory is a highly sophisticated feeding behavior that requires abilities of plant defense suppression, phytochemical detoxification, and plant macromolecule digestion. For plant-sucking insects, salivary glands (SGs) play important roles in herbivory by secreting and injecting proteins into plant tissues to facilitate feeding. Little is known on how insects evolved secretory SG proteins for such specialized functions. Here, we investigated the composition and evolution of secretory SG proteins in the brown marmorated stink bug (Halyomorpha halys) and identified a group of secretory SG phospholipase C (PLC) genes with highest sequence similarity to the bacterial homologs. Further analyses demonstrated that they were most closely related to PLCs of Xenorhabdus, a genus of Gammaproteobacteria living in symbiosis with insect-parasitizing nematodes. These suggested that H. halys might acquire these PLCs from Xenorhabdus through the mechanism of horizontal gene transfer (HGT), likely mediated by a nematode during its parasitizing an insect host. We also showed that the original HGT event was followed by gene duplication and expansion, leading to functional diversification of the bacterial-origin PLC genes in H. halys. Thus, this study suggested that an herbivore might enhance adaptation through gaining genes from an endosymbiont of its parasite in the tripartite parasitic and symbiotic interactions.