The symbiosis between fungus-growing ants and the fungi they cultivate for food has been shaped by 50 million years of coevolution. Phylogenetic analyses indicate that this long coevolutionary history includes a third symbiont lineage: specialized microfungal parasites of the ants' fungus gardens. At ancient levels, the phylogenies of the three symbionts are perfectly congruent, revealing that the ant-microbe symbiosis is the product of tripartite coevolution between the farming ants, their cultivars, and the garden parasites. At recent phylogenetic levels, coevolution has been punctuated by occasional host-switching by the parasite, thus intensifying continuous coadaptation between symbionts in a tripartite arms race.