information:filtering
Relationships between subgroups and families

The first true dipterans known are from the Middle Triassic (around 240 million years ago), and they became widespread during the Middle and Late Triassic. Modern flowering plants did not appear until the Cretaceous (around 140 million years ago), so the original dipterans must have had a different source of nutrition other than nectar. Based on the attraction of many modern fly groups to shiny droplets, it has been suggested that they may have fed on honeydew produced by sap-sucking bugs which were abundant at the time, and dipteran mouthparts are well-adapted to softening and lapping up the crusted residues. The basal clades in the Diptera include the Deuterophlebiidae and the enigmatic Nymphomyiidae. Three episodes of evolutionary radiation are thought to have occurred based on the fossil record. Many new species of lower Diptera developed in the Triassic, about 220 million years ago. Many lower Brachycera appeared in the Jurassic, some 180 million years ago. A third radiation took place among the Schizophora at the start of the Paleogene, 66 million years ago.

The phylogenetic position of Diptera has been controversial. The monophyly of holometabolous insects has long been accepted, with the main orders being established as Lepidoptera, Coleoptera, Hymenoptera and Diptera, and it is the relationships between these groups which has caused difficulties. Diptera is widely thought to be a member of Mecopterida, along with Lepidoptera (butterflies and moths), Trichoptera (caddisflies), Siphonaptera (fleas), Mecoptera (scorpionflies) and possibly Strepsiptera (twisted-wing flies). Diptera has been grouped with Siphonaptera and Mecoptera in the Antliophora, but this has not been confirmed by molecular studies.

Diptera were traditionally broken down into two suborders, Nematocera and Brachycera, distinguished by the differences in antennae. The Nematocera are identified by their elongated bodies and many-segmented, often feathery antennae as represented by mosquitoes and crane flies. The Brachycera have rounder bodies and much shorter antennae. Subsequent studies have identified the Nematocera as being non-monophyletic with modern phylogenies placing the Brachycera within grades of groups formerly placed in the Nematocera. The construction of a phylogenetic tree has been the subject of ongoing research. The following cladogram is based on the FLYTREE project.