Plants produce large amounts of secondary metabolites in their shoots and roots and store them in specialized secretory structures. Although secondary metabolites and their secretory structures are commonly assumed to have a defensive function, evidence that they benefit plant fitness under herbivore attack is scarce, especially below ground. Here, we tested whether latex secondary metabolites produced by the common dandelion (Taraxacum officinale agg.) decrease the performance of its major native insect root herbivore, the larvae of the common cockchafer (Melolontha melolontha), and benefit plant vegetative and reproductive fitness under M. melolontha attack. Across 17 T. officinale genotypes screened by gas and liquid chromatography, latex concentrations of the sesquiterpene lactone taraxinic acid β-D-glucopyranosyl ester (TA-G) were negatively associated with M. melolontha larval growth. Adding purified TA-G to artificial diet at ecologically relevant concentrations reduced larval feeding. Silencing the germacrene A synthase ToGAS1, an enzyme that was identified to catalyze the first committed step of TA-G biosynthesis, resulted in a 90% reduction of TA-G levels and a pronounced increase in M. melolontha feeding. Transgenic, TA-G-deficient lines were preferred by M. melolontha and suffered three times more root biomass reduction than control lines. In a common garden experiment involving over 2,000 T. officinale individuals belonging to 17 different genotypes, high TA-G concentrations were associated with the maintenance of high vegetative and reproductive fitness under M. melolontha attack. Taken together, our study demonstrates that a latex secondary metabolite benefits plants under herbivore attack, a result that provides a mechanistic framework for root herbivore driven natural selection and evolution of plant defenses below ground.