Leaf-cutting ants combine large-scale herbivory with fungus farming to sustain advanced societies. Their stratified colonies are major evolutionary achievements and serious agricultural pests, but the crucial adaptations that allowed this mutualism to become the prime herbivorous component of neotropical ecosystems has remained elusive. Here we show how coevolutionary adaptation of a specific enzyme in the fungal symbiont has helped leaf-cutting ants overcome plant defensive phenolic compounds. We identify nine putative laccase-coding genes in the fungal genome of Leucocoprinus gongylophorus cultivated by the leaf-cutting ant Acromyrmex echinatior. One of these laccases (LgLcc1) is highly expressed in the specialized hyphal tips (gongylidia) that the ants preferentially eat, and we confirm that these ingested laccase molecules pass through the ant guts and remain active when defecated on the leaf pulp that the ants add to their gardens. This accurate deposition ensures that laccase activity is highest where new leaf material enters the fungus garden, but where fungal mycelium is too sparse to produce extracellular enzymes in sufficient quantities to detoxify phenolic compounds. Phylogenetic analysis of LgLcc1 ortholog sequences from symbiotic and free-living fungi revealed significant positive selection in the ancestral lineage that gave rise to the gongylidia-producing symbionts of leaf-cutting ants and their non-leaf-cutting ant sister group. Our results are consistent with fungal preadaptation and subsequent modification of a particular laccase enzyme for the detoxification of secondary plant compounds during the transition to active herbivory in the ancestor of leaf-cutting ants between 8 and 12 Mya.