Of the 5000 fish species on coral reefs, corals dominate the diet of just 41 species. Most (61%) belong to a single family, the butterflyfishes (Chaetodontidae). We examine the evolutionary origins of chaetodontid corallivory using a new molecular phylogeny incorporating all 11 genera. A 1759-bp sequence of nuclear (S7I1 and ETS2) and mitochondrial (cytochrome b) data yielded a fully resolved tree with strong support for all major nodes. A chronogram, constructed using Bayesian inference with multiple parametric priors, and recent ecological data reveal that corallivory has arisen at least five times over a period of 12 Ma, from 15.7 to 3 Ma. A move onto coral reefs in the Miocene foreshadowed rapid cladogenesis within Chaetodon and the origins of corallivory, coinciding with a global reorganization of coral reefs and the expansion of fast-growing corals. This historical association underpins the sensitivity of specific butterflyfish clades to global coral decline.