The gut microbiota of animals exert major effects on host biology . Although horizontal transfer is generally considered the prevalent route for the acquisition of gut bacteria in mammals , some bacterial lineages have co-speciated with their hosts on timescales of several million years . Termites harbor a complex gut microbiota, and their advanced social behavior provides the potential for long-term vertical symbiont transmission, and co-evolution of gut symbionts and host [4–6]. Despite clear evolutionary patterns in the gut microbiota of termites , a consensus on how microbial communities were assembled during termite diversification has yet to be reached. Although some studies have concluded that vertical transmission has played a major role [8, 9], others indicate that diet and gut microenvironment have been the primary determinants shaping microbial communities in termite guts [7, 10]. To address this issue, we examined the gut microbiota of 94 termite species, through 16S rRNA metabarcoding. We analyzed the phylogeny of 211 bacterial lineages obtained from termite guts, including their closest relatives from other environments, which were identified using BLAST. The results provided strong evidence for rampant horizontal transfer of gut bacteria between termite host lineages. Although the majority of termite-derived phylotypes formed large monophyletic groups, indicating high levels of niche specialization, numerous other clades were interspersed with bacterial lineages from the guts of other animals. Our results indicate that “mixed-mode” transmission, which combines colony-to-offspring vertical transmission with horizontal colony-to-colony transfer, has been the primary driving force shaping the gut microbiota of termites. Using 16S rRNA metagenome data, Bourguignon et al. show that termite gut microbiota is shaped through “mixed-mode” transmission, combining colony-to-offspring vertical transmission with occasional horizontal colony-to-colony transfer on timescales of tens of million years.