Global warming is rapidly emerging as a universal threat to ecological integrity and function, highlighting the urgent need for a better understanding of the impact of heat exposure on the resilience of ecosystems and the people who depend on them. Here we show that in the aftermath of the record-breaking marine heatwave on the Great Barrier Reef in 2016, corals began to die immediately on reefs where the accumulated heat exposure exceeded a critical threshold of degree heating weeks, which was 3–4 °C-weeks.