Background: Magnaporthe oryzae (anamorph Pyricularia oryzae) is the causal agent of blast disease of Poaceae crops and their wild relatives. To understand the genetic mechanisms that drive host specialization of M. oryzae, we carried out whole genome resequencing of four M. oryzae isolates from rice (Oryza sativa), one from foxtail millet (Setaria italica), three from wild foxtail millet S. viridis, and one isolate each from finger millet (Eleusine coracana), wheat (Triticum aestivum) and oat (Avena sativa), in addition to an isolate of a sister species M. grisea, that infects the wild grass Digitaria sanguinalis.Results: Whole genome sequence comparison confirmed that M. oryzae Oryza and Setaria isolates form a monophyletic and close to another monophyletic group consisting of isolates from Triticum and Avena. This supports previous phylogenetic analysis based on a small number of genes and molecular markers. When comparing the host specific subgroups, 1.2–3.5 % of genes showed presence/absence polymorphisms and 0–6.5 % showed an excess of non-synonymous substitutions. Most of these genes encoded proteins whose functional domains are present in multiple copies in each genome. Therefore, the deleterious effects of these mutations could potentially be compensated by functional redundancy. Unlike the accumulation of nonsynonymous nucleotide substitutions, gene loss appeared to be independent of divergence time. Interestingly, the loss and gain of genes in pathogens from the Oryza and Setaria infecting lineages occurred more frequently when compared to those infecting Triticum and Avena even though the genetic distance between Oryza and Setaria lineages was smaller than that between Triticum and Avena lineages. In addition, genes showing gain/loss and nucleotide polymorphisms are linked to transposable elements highlighting the relationship between genome position and gene evolution in this pathogen species.Conclusion: Our comparative genomics analyses of host-specific M. oryzae isolates revealed gain and loss of genes as a major evolutionary mechanism driving specialization to Oryza and Setaria. Transposable elements appear to facilitate gene evolution possibly by enhancing chromosomal rearrangements and other forms of genetic variation.