Given the physiological limits to egg size, largebodied non-avian dinosaurs experienced some of the most extreme shifts in size during postnatal ontogeny found in terrestrial vertebrate systems. In contrast, mammals—the other dominant vertebrate group since the Mesozoic—have less complex ontogenies. Here, we develop a model that quantifies the impact of size-specific interspecies competition on abundances of differently sized dinosaurs and mammals, taking into account the extended niche breadth realized during ontogeny among large oviparous species. Our model predicts low diversity at intermediate size classes (between approx. 1 and 1000 kg), consistent with observed diversity distributions of dinosaurs, and of Mesozoic land vertebrates in general. It also provides a mechanism—based on an understanding of different ecological and evolutionary constraints across vertebrate groups—that explains how mammals and birds, but not dinosaurs, were able to persist beyond the Cretaceous–Tertiary (K–T) boundary, and how post-K–T mammals were able to diversify into larger size categories.