The ancestors of fungi are believed to be simple aquatic forms with flagellated spores, similar to members of the extant phylum Chytridiomycota (chytrids). Current classifications assume that chytrids form an early-diverging clade within the kingdom Fungi and imply a single loss of the spore flagellum, leading to the diversification of terrestrial fungi. Here we develop phylogenetic hypotheses for Fungi using data from six gene regions and nearly 200 species. Our results indicate that there may have been at least four independent losses of the flagellum in the kingdom Fungi. These losses of swimming spores coincided with the evolution of new mechanisms of spore dispersal, such as aerial dispersal in mycelial groups and polar tube eversion in the microsporidia (unicellular forms that lack mitochondria). The enigmatic microsporidia seem to be derived from an endoparasitic chytrid ancestor similar to Rozella allomycis, on the earliest diverging branch of the fungal phylogenetic tree.