Ecosystems changed dramatically during the Mesozoic marine revolution, including the rise of decapod crustaceans such as lobsters, shrimp, true crabs, and squat lobsters. However, quantitative patterns of decapod biodiversity through geological time are virtually unknown. This hampers our understanding of their importance in past ecosystems and timing and causes of their radiations and extinctions. Based on our compilation of ∼1300 Mesozoic decapod species, we document a long-term shift in diversity of dominant groups, marked by the first appearance and increasing presence of true crabs and, to a lesser extent, squat lobsters. By the end of the Mesozoic, true crabs became the primary contributor to decapod diversity, a pattern that has persisted until the present time. This “Mesozoic decapod revolution” was advanced by a major radiation of reef-dwelling crabs, which coincided with a dramatic expansion of reefs in the Late Jurassic. The subsequent collapse of reefs near the end of the Jurassic was mirrored by a sharp (albeit temporary) drop in decapod diversity driven primarily by extinctions of numerous species of crabs. This concurrent decline also suggests that decapods inhabiting reefs, especially obligatory reef dwellers, may face elevated extinction risks today as reef ecosystems continue to deteriorate. The reef-related diversification of Late Jurassic decapods and the significant correlation between decapod diversity and reef abundance throughout the Mesozoic underscore the macroevolutionary importance of biotic interactions and ecosystem engineering.