Host-microbe symbioses play a critical role in the evolution of biological diversity and complexity. In a notably intricate system, southern pine beetles use symbiotic fungi to help overcome host-tree defenses and to provide nutrition for their larvae. We show that this beetle-fungal mutualism is chemically mediated by a bacterially produced polyunsaturated peroxide. The molecule's selective toxicity toward the beetle's fungal antagonist, combined with the prevalence and localization of its bacterial source, indicates an insect-microbe association that is both mutualistic and coevolved. This unexpected finding in a well-studied system indicates that mutualistic associations between insects and antibiotic-producing bacteria are more common than currently recognized and that identifying their small-molecule mediators can provide a powerful search strategy for therapeutically useful antimicrobial compounds.