Hymenoptera (sawflies, wasps, ants, and bees) are one of four mega-diverse insect orders, comprising more than 153,000 described and possibly up to one million undescribed extant species [1, 2]. As parasitoids, predators, and pollinators, Hymenoptera play a fundamental role in virtually all terrestrial ecosystems and are of substantial economic importance [1, 3]. To understand the diversification and key evolutionary transitions of Hymenoptera, most notably from phytophagy to parasitoidism and predation (and vice versa) and from solitary to eusocial life, we inferred the phylogeny and divergence times of all major lineages of Hymenoptera by analyzing 3,256 protein-coding genes in 173 insect species. Our analyses suggest that extant Hymenoptera started to diversify around 281 million years ago (mya). The primarily ectophytophagous sawflies are found to be monophyletic. The species-rich lineages of parasitoid wasps constitute a monophyletic group as well. The little-known, species-poor Trigonaloidea are identified as the sister group of the stinging wasps (Aculeata). Finally, we located the evolutionary root of bees within the apoid wasp family "Crabronidae." Our results reveal that the extant sawfly diversity is largely the result of a previously unrecognized major radiation of phytophagous Hymenoptera that did not lead to wood-dwelling and parasitoidism. They also confirm that all primarily parasitoid wasps are descendants of a single endophytic parasitoid ancestor that lived around 247 mya. Our findings provide the basis for a natural classification of Hymenoptera and allow for future comparative analyses of Hymenoptera, including their genomes, morphology, venoms, and parasitoid and eusocial life styles.