Despite the vast diversity of phytophagous insects that feed on vascular plants (tracheophytes), insects that feed on bryophytes remain understudied. Agromyzidae, one of the most species-rich phytophagous clades in Diptera, consists mainly of leaf-mining species that feed on tracheophytes. However, a recent discovery of thallus-mining species on liverworts and hornworts within the
Liriomyza
group of Phytomyzinae provides an opportunity to study host shifts between tracheophytes and bryophytes. This study aimed to explore the origin and diversification of thallus-miners and estimate the pattern and timing of host shifts. Phylogenetic analysis of Phytomyzinae has revealed that the thallus-mining agromyzids formed a separate clade, which was sister to a fern pinnule-miner. The diversification of bryophyte-associated agromyzids since the Oligocene involved multiple host shifts across various bryophyte taxa. The diversification of the thallus-mining
Phytoliriomyza
may have occurred at the same time as the leaf-mining agromyzid flies on herbaceous plants, indicating a dynamic history of interactions between bryophytes and herbivores in angiosperms-dominated ecosystems.