Things have been looking pretty grim for Tasmanian devils of late. Over the past 20 years, nearly 80 percent of this unique Australian species has been wiped out thanks to a contagious facial cancer, and there's no effective treatment.

But a recent analysis of devils who happened to survive the epidemic has revealed certain genetic changes that appear to be protecting them from infection. In other words, these animals have been evolving resistance to cancer in just two decades.

"Our hope was that we would find some genes that were perhaps associated with cancer or resistance to cancer or immune function," lead researcher Andrew Storfer from Washington State University told Michael Slezak at The Guardian.

"And in fact, we did find seven different genes in two small regions of the genome that seem to have implications for cancers in other animals, including humans."

If you're not familiar with devil facial tumour disease (DFTD), prepare your eyes and hearts, because (NSFL warning) this is what it does

It's not clear exactly how DFTD originated, but it's been traced back to a single cell in a female devil that became cancerous, and since the first case was diagnosed in 1996, the disease has wiped out all but 20 percent of the global population. 

The worst thing about this disease isn't the fact that it has a 100 percent mortality rate, or that it causes massive, bloody tumours and open wounds to erupt and spread over the face and neck, killing any devil infected by either suffocating them or preventing them from eating. 

That's bad, but what worse is how easily DFTD is spread. 

For Tasmanian devils, biting or mouthing at each other's faces is a primary mode of communication.

They do it as joeys when they're playing, they do it as adults when engaging in turf wars, and they do it a lot when mating. And every time an infected devil bites another devil, it's a death sentence.

face-bitingBernhard Richter/Shutterstock.com

With the way things are going, researchers were facing the possibility that the cancer would wipe out the entire species within the next decade or so, because while progress has been made towards a treatment or a vaccine, so far, nothing has worked. 

But it looks like the devils have been putting up a fight on their own this whole time.

The Washington State University team got access to the genomes of 294 Tasmanian devils in three populations in Australia, which had been taken at various stages - before, during, and after the arrival of DFTD.

They scanned these genomes for any changes that might have occurred over time in response to the disease, and found evidence of evolution in two small portions of the Tasmanian devil genome.

These portions contained seven genes, and the team found that certain variants of these genes increased in frequency four to six generations after the arrival of DFTD. This was true of samples from all three populations tested.

At least five of these genes have been linked to immune response and cancer in other mammals, leading the researchers to suggest that this is evidence of a natural defence mechanism in the works.

"Particularly, there are several that seem to be involved in directing immune cells to dysfunctional cells or pathogens, and we think those are particularly promising," one of the team, Brendan Epstein, told Jonathan Webb at BBC News.

The researchers report that such a rapid evolutionary response to a highly lethal, newly arrived pathogen has rarely, if ever, been documented in wild species, and say it could explain how the Tasmanian devil has held out for so long against such a quickly spreading, lethal disease.

"First and foremost, this gives us hope for the survival of the Tasmanian devil, which is predicted to be extinct but isn't," Storfer told the BBC. "We see that the devils apparently are evolving genes that may be associated with resistance to the disease."

The next step is to figure out exactly what these seven genes do, and then explore the possibility of selectively breeding individuals with resistance to strengthen what's left of the population.

It's the best news we've heard about the fate of Tasmanian devils for years, but Storfer says we shouldn't be so surprised. If it's happening now, he told Sarah Kaplan at The Washington Post, it's probably happened before:

"The fact that a second tumour evolved independently of the first, this seems very unlikely to happen by chance in just 20 years. That leads to speculation that this is part of the evolutionary history of the devil and maybe they've survived it before." 

So chin up, little devils. You've got this.

happy-devilGlobal Wildlife Conservation/Flickr

The study has been published in Nature Communications.