The pterosaurs, Mesozoic flying reptiles, attained wingspans of more than 10 m that greatly exceed the largest birds and challenge our understanding of size limits in flying animals. Pterosaurs have been used to illustrate Cope's rule, the influential generalization that evolutionary lineages trend to increasingly large body sizes. However, unambiguous examples of Cope's rule operating on extended timescales in large clades remain elusive, and the phylogenetic pattern and possible drivers of pterosaur gigantism are uncertain. Here we show 70 million years of highly constrained early evolution, followed by almost 80 million years of sustained, multi-lineage body size increases in pterosaurs. These results are supported by maximum-likelihood modelling of a comprehensive new pterosaur data set. The transition between these macroevolutionary regimes is coincident with the Early Cretaceous adaptive radiation of birds, supporting controversial hypotheses of bird-pterosaur competition, and suggesting that evolutionary competition can act as a macroevolutionary driver on extended geological timescales.