Phylogenetic and biogeographic analyses can enhance our understanding of multispecies interactions by placing the origin and evolution of such interactions in a temporal and geographical context. We use a phylogenomic approach-ultraconserved element sequence capture-to investigate the evolutionary history of an iconic multispecies mutualism: Neotropical acacia ants (Pseudomyrmex ferrugineus group) and their associated Vachellia hostplants. In this system, the ants receive shelter and food from the host plant, and they aggressively defend the plant against herbivores and competing plants. We confirm the existence of two separate lineages of obligate acacia ants that convergently occupied Vachellia and evolved plant-protecting behaviour, from timid ancestors inhabiting dead twigs in rainforest. The more diverse of the two clades is inferred to have arisen in the Late Miocene in northern Mesoamerica, and subsequently expanded its range throughout much of Central America. The other lineage is estimated to have originated in southern Mesoamerica about 3 Myr later, apparently piggy-backing on the pre-existing mutualism. Initiation of the Pseudomyrmex/Vachellia interaction involved a shift in the ants from closed to open habitats, into an environment with more intense plant herbivory. Comparative studies of the two lineages of mutualists should provide insight into the essential features binding this mutualism.