“The Earth has been beset by many crises during its history, and yet comparing the ecological impacts of these mass extinctions has been difficult. Key questions concern the kinds of species that go extinct and survive, how communities rebuild in the post-extinction recovery phase, and especially how the scaling of events affects these processes. Here, we explore ecological impacts of terrestrial and freshwater ecosystems in three mass extinctions through the mid-Phanerozoic, a span of 121 million years (295-174 Ma). This critical duration encompasses the largest mass extinction of all time, the Permian-Triassic (P-Tr) and is flanked by two smaller crises, the Guadalupian-Lopingian (G-L) and Triassic-Jurassic (T-J) mass extinctions. Palaeocommunity dynamics modelling of 14 terrestrial and freshwater communities through a long sedimentary succession from the lower Permian to the lower Jurassic in northern Xinjiang, northwest China, shows that the P-Tr mass extinction differed from the other two in two ways: (i) ecological recovery from this extinction was prolonged and the three post-extinction communities in the Early Triassic showed low stability and highly variable and unpredictable responses to perturbation primarily following the huge losses of species, guilds and trophic space; and (ii) the G-L and T-J extinctions were each preceded by low-stability communities, but post-extinction recovery was rapid. Our results confirm the uniqueness of the P-Tr mass extinction and shed light on the trophic structure and ecological dynamics of terrestrial and freshwater ecosystems across the three mid-Phanerozoic extinctions, and how complex communities respond to environmental stress and how communities recovered after the crisis. Comparisons with the coeval communities from the Karoo Basin, South Africa show that geographically and compositionally different communities of terrestrial ecosystems were affected in much the same way by the P-Tr extinction.”