There may yet be hope for the Tasmanian devil.

The marsupial carnivores have been struck with a lethal and contagious cancer that has reduced their population by 80 percent. But now scientists believe that the animals have found a way to fight back: a genetic variation in some individuals that may make them resistant.

In a study published in Nature Communications, researchers examined the genomes of three isolated populations of devils living in different parts of Tasmania. In each population, the scientists found two regions of the genome that were rapidly changing; both contain genes related to immune function or cancer risk. This genetic variation may be the key to avoiding extinction.

“The populations are evolving independently, but changes across all three are consistent,” said the senior author of the paper, Andrew Storfer, a professor of biology at Washington State University. “This makes what we found more compelling.”