A phylogenetic analysis of the Mycetophiliformia (= Sciaroidea) was performed to determine the relationships among its families and to place the following genera of uncertain position in the system: Heterotricha, Ohakunea, Colonomyia, Freemanomyia, Rhynchoheterotricha, Chiletricha, Afrotricha, Anisotricha, Kenyatricha, Nepaletricha, Sciarosoma, Sciaropota, Insulatricha, Cabamofa, Rogambara, and Starkomyia. Eratomyia n. gen. is described based on a new species from Ecuador. Colonomyia brasiliana sp.n. and Colonomyia freemani sp.n. are described respectively from southern Brazil and Chile. The male of Cabamofa mira Jaschhof is described for the first time. A total of 64 terminal taxa and 137 transformation series (with 202 characters) were included in the data matrix, with a number of new features from thoracic morphology. Willi Hennig’s 1973 system for the higher Bibionomorpha was adopted using the name Mycetophiliformia for the Sciaroidea. The Mycetophiliformia are monophyletic. The family Cecidomyiidae appears as the sister group of the remaining Mycetophiliformia, followed by the Sciaridae. In the preferred topology, the Rangomaramidae appear as the group sister of a clade consisting of (Ditomyiidae + Bolitophilidae + Diadocidiidae + Keroplatidae) and of (Lygistorrhinidae + Mycetophilidae). The topology within the Rangomaramidae is (Chiletrichinae subfam. n. (Heterotrichinae subfam. n. ((Rangomaraminae + Ohakuneinae subfam. n.))). The Chiletrichinae include the genera Kenyatricha, Rhynchoheterotricha, Insulatricha, Chiletricha, and Eratomyia n. gen. Heterotrichinae and Rangomaraminae are monotypic. The subfamily Ohakuneinae includes Ohakunea, Colonomyia, Cabamofa, and Rogambara. The positions of Freemanomyia, Loicia, Taxicnemis, Sciaropota, Starkomyia, Anisotricha, Nepaletricha, and Sciarosoma are considered. Afrotricha might belong to the Sciaridae. The similarities used by many authors to gather the Sciaridae and Mycetophilidae in a clade are shown to be a combination of plesiomorphies and homoplasies.