The phylogeny of the fungus gnat family Mycetophilidae (Diptera) is reconstructed with a focus on the species-rich and taxonomically difficult subfamilies Gnoristinae and Mycomyinae. The multigene phylogenetic analyses are based on five nuclear (18S, 28S, CAD, MCS, ITS2) and four mitochondrial (12S, 16S, COI, CytB) gene markers. The analyses strongly support the monophyly of Mycetophilidae and the subfamilies Manotinae, Sciophilinae, Leiinae, and Mycomyinae, although Gnoristinae is paraphyletic with respect to Mycetophilinae. All the genera and groups of genera included are supported as monophyletic, except for Acomoptera Vockeroth, Boletina Staeger, Dziedzickia Johannsen, Ectrepesthoneura Enderlein, and Neoempheria Osten Sacken. Ancestral character state reconstructions were applied to two morphological features present in Gnoristinae and Mycomyinae (i.e. presence of setae on wing membrane and wing vein R 4 ) in order to assess their evolution. The wing vein R 4 appears as an unstable character, spread throughout different clades. A dated phylogeny of the family Mycetophilidae showed that most of the subfamilies of Mycetophilidae originated and diversified during the Cretaceous. The youngest subfamilies, originated in the Paleogene, appear to be Mycomyinae and Mycetophilinae.