Protection from direct human impacts can safeguard marine life, yet ocean warming crosses marine protected area boundaries. Here, we test whether protection offers resilience to marine heatwaves from local to network scales. We examine 71,269 timeseries of population abundances for 2269 reef fish species surveyed in 357 protected versus 747 open sites worldwide. We quantify the stability of reef fish abundance from populations to metacommunities, considering responses of species and functional diversity including thermal affinity of different trophic groups. Overall, protection mitigates adverse effects of marine heatwaves on fish abundance, community stability, asynchronous fluctuations and functional richness. We find that local stability is positively related to distance from centers of high human density only in protected areas. We provide evidence that networks of protected areas have persistent reef fish communities in warming oceans by maintaining large populations and promoting stability at different levels of biological organization.