When I was eleven, we buried my first dog under an apple tree. We got another one soon after, and he died about a decade later while I was away at college. That was a pretty typical experience when it comes to kids and dogs. In a study published last year, British researchers found that the median lifespan of a pet dog was all of twelve years. Dogs can be fine companions over the course of a human childhood, but they are hardly Methuselahs.

There is, however, one remarkable exception. A dog that was born 11,000 years ago stumbled across the elixir of life, and is still alive today. It didn’t find immortality through a diet of mung beans or daily doses of resveratrol. Instead, that ancient dog employed a more radical solution. Some of its cells became cancerous and invaded other dogs, and those dogs then spread its cells to still other dogs. That ancient dog lives on today in the bodies of countless dogs around the world today.

The first record of this immortal dog appeared over 200 years ago in a book called A Domestic Treatise on the Diseases of Horses and Dogs, published in 1810 by a British veterinarian named Delabere Pritchett Blaine. Blaine had seen dogs with a kind of cancer that he described as “an ulcerous state, accompanied with a fungous excrescence” that arises in “organs concerned in generation.”

Veterinarians became more familiar with the cancer in the following decades. A tumor the shape of a cauliflower would appear around a dog’s genitals, growing quickly and becoming prone to bleeding. Some dogs died from the cancer, although many of others experienced a remarkable cure: after a few months, the tumors spontaneously shrank and vanished on their own, never to return.

In 1871, a Russian veterinarian proved that these tumors were actually infections. He cut off a bit of a tumor from one dog and then rubbed it around the genitals of another. The second dog got cancer, too. Like the bacteria that cause syphilis or the virus that causes AIDS, the cancer took advantage of sexual contact to spread to new hosts. Since then, canine Transmissible Venereal Tumor, or CTVT for short, has turned up in dogs on every continent.

CTVT remained an obscure condition known only to vets for decades. But it has gained a scientific celebrity in recent years, as scientists have started to examine the DNA in the cancer cells. If CTVT was an ordinary form of cancer, the DNA in a tumor would be a modified version of the DNA in the dog’s healthy cells. But CTVT is far from ordinary. The DNA in one tumor is very similar to the DNA in other tumors–even tumors growing in dogs on the other side of the world.

To get a deeper understanding of this cancer’s remarkable history, a team of scientists led by Elizabeth Murchinson of the University of Cambridge has now sequenced two entire CTVT genomes for the first time. They published their analysis of the genomes today in the journal Science.

Murchison and her colleagues selected two sick dogs from opposite ends of the canine universe for their study: one is a so-called “camp dog” that that live alongside Australian Aborigines. The other dog is a cocker spaniel in Brazil.

As distant as the two dogs might be, their cancer cells are very similar. Murchison and her colleagues found that their genomes share about two million mutations in common that are not found in ordinary dog cells That staggeringly huge collection of mutations is a powerful arsenal of evidence that the tumors descend from a common ancestor, rather than having evolved independently from normal cells in different dogs.

Those mutations also gave Murchison and her colleagues a molecular clock they could use to estimate how long ago the cancer originated from an ordinary dog cell. When cancer cells grow and divide, some of their DNA mutates at a roughly regular rate. In an ordinary tumor in humans, a few thousand of these mutations might accumulate. The two million mutations found in the CTVT genomes show that they’re far older than a few years. In fact, they suggest that the cancer originated in a dog 11,000 years ago, just as the Ice Age was ending.

In the past, scientists have debated whether CTVT got its start in a dog or a wolf, which then mated with a dog. This new research settles that debate in favor a dog. And not just any dog. The cancer cell genomes are most similar to those of huskies and Alaskan malamutes, which belong to one of the oldest lineages of domesticated dogs.

Here, then, is how it seems that a malamute-like dog got to live forever. One of its immune cells turned cancerous and grew into a tumor somewhere around its genitals (Murchison and her colleagues can’t say if the dog was male or female). Inside that original dog, the cancer accumulated hundreds or thousands of mutations. When the dog mated, some of the cancer cells from the bleeding tumor slipped into the body of its partner.

Normally, this should have been the end of the story. Immune cells in the second dog should have recognized the foreign cancer cells and wiped them out. Murchison and her colleagues suggest that this didn’t happen because the dogs belonged to an early population that was very small. Small populations can also be very inbred, with little genetic diversity. That similarity may have made it hard for the immune system of the second dog to distinguish the cancer cells from itself. The cancer cells exploited this loophole and grew in their new host. When the second dog mated with a third, the cancer spread further.

Along the way from dog to dog, the cancer continued to evolve. As the cells divided, some picked up mutations that allowed them to grow faster than others. The cancer adapted to its new way of life as a parasite. As it spread out of its original population, it evolved new deceptions to escape the notice of other immune systems, enabling it to infect other breeds. And it has never lost its ability to grow, even as a thousand generations of dogs it inhabited have died. (One source of its immortality may be its ability to steal energy-generating factories from the cells of its hosts.

Intriguingly, Murchison and her colleagues found that relatively few mutations are unique to the two tumors. The scientists estimate that the two tumors share a common ancestor that lived just 460 years ago. That’s around the time that dog breeders produced many of today’s breeds. It’s also when Europeans started colonizing many parts of the world, bringing their cancer-laden dogs with them. We have created propitious conditions for the global spread of a contagious cancer.

As sinister as CTVT may seem, it could be a lot more dangerous. You need only compare it to the only other known example of contagious cancer in the wild–a facial tumor that is spreading among Tasmanian devils. Like CTVT, the devil’s tumor spreads by taking advantage of the contact Tasmanian devils make with each other–instead of mating, they spread when the devils bite each other in the face during fights. But they’re drastically different in how they affect their host. CTVT typically disappears spontaneously from dogs. The devil’s tumor can balloon so fast that it often kills a Tasmanian devil in a matter of months.