Butterflies (Papilionoidea), with over 18,000 described species [1], have captivated naturalists and scientists for centuries. They play a central role in the study of speciation, community ecology, biogeography, climate change, and plant-insect interactions and include many model organisms and pest species [2, 3]. However, a robust higher-level phylogenetic framework is lacking. To fill this gap, we inferred a dated phylogeny by analyzing the first phylogenomic dataset, including 352 loci (> 150,000 bp) from 207 species representing 98% of tribes, a 35-fold increase in gene sampling and 3-fold increase in taxon sampling over previous studies [4]. Most data were generated with a new anchored hybrid enrichment (AHE) [5] gene kit (BUTTERFLY1.0) that includes both new and frequently used (e.g., [6]) informative loci, enabling direct comparison and future dataset merging with previous studies. Butterflies originated around 119 million years ago (mya) in the late Cretaceous, but most extant lineages diverged after the Cretaceous-Paleogene (K-Pg) mass-extinction 65 mya. Our analyses support swallowtails (Papilionidae) as sister to all other butterflies, followed by skippers (Hesperiidae) + the nocturnal butterflies (Hedylidae) as sister to the remainder, indicating a secondary reversal from diurnality to nocturnality. The whites (Pieridae) were strongly supported as sister to brush-footed butterflies (Nymphalidae) and blues + metalmarks (Lycaenidae and Riodinidae). Ant association independently evolved once in Lycaenidae and twice in Riodinidae. This study overturns prior notions of the taxon's evolutionary history, as many long-recognized subfamilies and tribes are para- or polyphyletic. It also provides a much-needed backbone for a revised classification of butterflies and for future comparative studies including genome evolution and ecology.