The Great Barrier Reef fared better during an oceanic heat wave last year than during sizzling weather a year earlier that caused hundreds of miles of corals to bleach, according to a study published Monday that suggests the massive structure may be growing more tolerant to climate change.

The report in the journal Nature Climate Change analyzed how corals along the Great Barrier fared in back-to-back mass bleaching events. The reef ― a UNESCO World Heritage Site and the largest living structure on the planet ― was cooked by overheated seawater in 2016 and again in 2017, with images of sickly white coral horrifying people around the globe.

But the second event last year, which saw seas even hotter than 2016 in many places, didn’t harm the reef as badly as scientists expected. They speculated that the structure may be going through a forced evolution that has helped toughen it, at least in part.

“The good news is the Barrier Reef glass is still half-full,” said Terry Hughes, a lead author of the study and the director of the ARC Centre of Excellence for Coral Reef Studies. “Whether we’ll still have reefs in 50 years time ... there’s a glimmer of hope that we will.”

Hughes noted that many of the corals that fared better last year were toucher species that aren’t as susceptible to coral bleaching. Other, more vulnerable species were wiped out in some parts of the reef early on. “Dead corals can’t re-bleach,” he observed.

David Gray/Reuters A ranger inspects the Great Barrier Reef near Lady Elliot Island, Australia. The reef experienced back-to-back bleaching events in 2016 and 2017.

“That’s a bit of a silver lining,” Hughes said. “There’s a prospect for acclimation, there might be an evolutionary response [among corals] that can make a mix that’s tougher.”

Bleaching happens when coral effectively gets cooked by seawater, forcing delicate algae that live inside the coral’s colorful skeleton to flee. That leaves the structure ghostly white. Bleached corals aren’t dead, and can recover if ocean temperatures return to normal. But prolonged periods of hot water can kill them and devastate entire reefs.

Hughes and his colleagues, including researchers from the National Oceanic and Atmospheric Association, the Australian Institute for Marine Science and James Cook University, said the study shows that time is running out to address the reef’s health.

A recent report by the United Nations scientific panel on climate change warned of a mass die-off of coral reefs as early as 2040, and a study released last week found the planet emitted more greenhouse gasses ― the main driver of climate change ― in 2018 than in any other time in history.

Scientists have warned that the world must limit global warming to 1.5 degrees Celsius above pre-industrial levels if the planet hopes to stave off the worst effects of climate change, a prospect that looks increasingly unlikely.

Hughes has long warned that the Great Barrier, already knocked on its back by warming seas, may not have much fight left.

“Clearly there’s no time to lose,” he said. “We did lose half the corals in just two years. By any measure that’s an incredible loss.”