Want climate news in your inbox? Sign up here for Climate Fwd:, our email newsletter.

Among the threatened corals of Australia’s Great Barrier Reef, one of the natural wonders of the world that has been ravaged by global warming, researchers have found a reason for optimism — or at least a reason not to despair completely.

Coral reefs, which by some estimates support a quarter of all ocean life, are harmed by warming oceans. The effects can be seen in the loss of their vibrant colors, a phenomenon known as bleaching. But after ocean temperatures s urged in 2016 around the Great Barrier Reef, causing severe damage , researchers found that the corals that survived were more resistant to another period of extreme warmth the following year.

“It’s one enormous natural selection event,” said Terry Hughes, an expert on coral reefs at James Cook University in Australia and the lead author of a study published Monday in the journal Nature Climate Change. In effect, the 2016 heat wave killed off many of the most heat-sensitive corals and selected for the corals that could handle higher ocean temperatures.

“So when the heat returned in 2017, the susceptible corals had been substantially depleted,” Dr. Hughes said. “The new coral assemblage, if you like, at the beginning of the second heat waves, was made up predominantly of the more heat-tolerant species, the more robust ones.”