For years, Tasmanian devils have been ravaged by gnarly facial tumors, cutting their numbers and pushing them toward extinction — but a new study suggests they may pull through after all.

Scientists at the University of Tasmania have been collecting genetic samples from the devils since before the cancer started spreading. That let an international team of researchers analyze genetic changes — which showed that these bad-tempered teddy bears are evolving in response to the disease, according a report in the journal Nature Communications.

Tasmanian devils are known for their love nips

The problem with the facial tumors is that they’re contagious — and Tasmanian devils are known for their love nips. They bite each other on the face a lot, especially when they’re mating. When they do, they spread the contagious cancer cells that develop into deforming growths. Those growths are a death sentence; they typically kill the creatures within six months. The animals have been coping with the tumors for 20 years, and a decade ago, scientists thought the cancer might drive the devils to extinction. It’s wiped out nearly 80 percent of Tasmanian devils in these last few decades. But since so few survive, it’s an excellent chance to see evolution in action.

That’s because the few animals that do evade the cancer are the ones that survive long enough to pass on their genes — which means those genes wind up getting more broadly incorporated into the population as time goes on. So the cancer actually selects for the devils best-equipped to withstand it, by killing all the other ones.

"It is really remarkable, the fact that we are able to use this modern sequencing technology to find these needles in a haystack across the genome," says Paul Hohenlohe, a genomicist at the University of Idaho and one of the study’s co-authors.

Two regions on the Tasmanian devils’ genome seemed to be under the most intense pressure. Both contain genes that are involved in immune function and cancer risk. That could mean these genes are helping the devils beat the cancer back, resist infection in the first place, or it could mean the genes at least prolong the beasts’ survival long enough to reproduce.

"I think now there’s a feeling that devils are learning to live with the disease."

This is a positive story, says Kathy Belov, a genomicist with the University of Sydney who was not involved with the research. "Ten years ago, things were looking bleak," she says. "I think now there’s a feeling that devils are learning to live with the disease."

That’s not impossible. Unlike cancers in humans that are caused by viruses (think HPV and cervical cancer), the cancer cells themselves are what spread the disease. That’s like if you could catch skin cancer by rubbing up against someone else’s tumor (which you can’t). Only two other similar types of cancer exist, one in clams and one in dogs. The dog one, a contagious, sexually transmitted tumor, has been spreading for the last 11,000 years and typically isn’t fatal. If this example holds true for the devils, it’s possible that they and their tumors could reach a similar evolutionary accord.

Today’s finding "gives us hope that the devils will be able to evolve in the face of the disease," Hohenlohe says. "And perhaps even evolve resistance."

It might be possible to identify genes associated with survival and then selectively breed Tasmanian devils to help evolution along, the authors of the paper say. But Belov doesn’t think that’s a great idea. Given that the cancer is already limiting the Tasmanian devil gene pool, she thinks that selective breeding might winnow it too far, putting the species at risk for other diseases.

The stakes for Tasmanian devil survival are higher than just protecting a charismatic (and vicious) creature. They play a critical role as scavengers in their island ecosystem, keeping the environment free of decaying dead bodies by eating them. If they were to vanish entirely, non-native foxes and feral cats would rush in to fill their voided niche — but that could upend the ecosystem, by spreading diseases like toxoplasmosis. So what’s good for the devil, is good for Tasmania.