Plants produce chemical defenses that poison insect herbivores or deter their feeding, but herbivores are also accompanied by microbial endosymbionts crucial for their nutrition, reproduction, and fitness. Hence, plant defenses could target a herbivore's beneficial endosymbionts, but this has not yet been demonstrated. Here, we studied flavonoids that are induced when rice is attacked by a phloem-feeding pest, the brown planthopper (BPH), which harbors beneficial yeast-like symbionts (YLS) essential for insect nutrition, such as by remedying deficiencies in sterols. BPH attack dramatically increased sakuranetin accumulations in leaf sheaths and phloem exudates. Sakuranetin is an antifungal phytoalexin derived from the antibacterial precursor, naringenin, via catalysis of naringenin-