The Cretaceous-Paleogene mass extinction approximately 66 million years ago is conventionally thought to have been a turning point in mammalian evolution(1,2). Prior to that event and for the first two-thirds of their evolutionary history, mammals were mostly confined to roles as generalized, small-bodied, nocturnal insectivores(3), presumably under selection pressures from dinosaurs(4). Release from these pressures, by extinction of non-avian dinosaurs at the Cretaceous-Paleogene boundary, triggered ecological diversification of mammals(1,2). Although recent individual fossil discoveries have shown that some mammalian lineages diversified ecologically during the Mesozoic era(5), comprehensive ecological analyses of mammalian groups crossing the Cretaceous-Paleogene boundary are lacking. Such analyses are needed because diversification analyses of living taxa(6,7) allow only indirect inferences of past ecosystems. Here we show that in arguably the most evolutionarily successful clade of Mesozoic mammals, the Multituberculata, an adaptive radiation began at least 20 million years before the extinction of non-avian dinosaurs and continued across the Cretaceous-Paleogene boundary. Disparity in dental complexity, which relates to the range of diets, rose sharply in step with generic richness and disparity in body size. Moreover, maximum dental complexity and body size demonstrate an adaptive shift towards increased herbivory. This dietary expansion tracked the ecological rise of angiosperms(8) and suggests that the resources that were available to multituberculates were relatively unaffected by the Cretaceous-Paleogene mass extinction. Taken together, our results indicate that mammals were able to take advantage of new ecological opportunities in the Mesozoic and that at least some of these opportunities persisted through the Cretaceous-Paleogene mass extinction. Similar broad-scale ecomorphological inventories of other radiations may help to constrain the possible causes of mass extinctions(9,10).