The anaerobic gut fungi (AGF), or Neocallimastigomycota, inhabit the rumen and alimentary tract of herbivorous mammals, where they play important roles in the degradation of plant fiber. Comparative genomic and phylogenomic analyses of the AGF have long been hampered by their fastidious growth condition, as well as their large (up to 200 Mb) and AT-biased (78 to 84%) genomes. We sequenced 21 AGF transcriptomes and combined them with 5 available AGF genome sequences to explore their evolutionary relationships, time their divergence, and characterize gene gain/loss patterns associated with their evolution. We estimate that the most recent common ancestor of the AGF diverged 66 (±10) million years ago, a time frame that coincides with the evolution of grasses (Poaceae), as well as the mammalian transition from insectivory to herbivory. The concordance of independent estimations suggests that AGF have been important in shaping the success of mammalian herbivory transition by improving the efficiency of energy acquisition from recalcitrant plant materials. Comparative genomics identified multiple lineage-specific genes in the AGF, two of which were acquired from rumen gut bacteria and animal hosts via horizontal gene transfer (HGT). A third AGF domain, plant-like polysaccharide lyase, represents a novel gene in fungi that potentially aids AGF to degrade pectin. Analysis of genomic and transcriptomic sequences confirmed both the presence and expression of these lineage-specific genes in nearly all AGF clades. These genetic elements may contribute to the exceptional abilities of AGF to degrade plant biomass and enable metabolism of the rumen microbes and animal hosts.IMPORTANCE Anaerobic fungi living in the rumen of herbivorous mammals possess an extraordinary ability to degrade plant biomass. We examined the origin and genomic composition of these poorly characterized anaerobic gut fungi using both transcriptome and genomic data. Phylogenomics and molecular dating analyses found remarkable concurrence of the divergence times of the rumen fungi, the forage grasses, and the dietary shift of ancestral mammals from primarily insectivory to herbivory. Comparative genomics identified unique machinery in these fungi to utilize plant polysaccharides. The rumen fungi were also identified with the ability to code for three protein domains with putative functions in plant pectin degradation and microbial defense, which were absent from all other fungal organisms (examined over 1,000 fungal genomes). Two of these domains were likely acquired from rumen gut bacteria and animal hosts separately via horizontal gene transfer. The third one is a plant-like polysaccharide lyase, representing a unique fungal enzyme with potential pectin breakdown abilities.