High in the Himalayas, a heavy-coated dog trots behind the hem of a Buddhist monk’s robes. On the streets of Panama City, another dog collapses into a sliver of shade, escaping the heat of the midday sun. On their bodies a cancer grows. Their tumors each appear unique—their swollen, crumbling contours flush with fresh blood vessels emerging from beneath a tail here or between the legs there. But the cells dividing inside each one, continents apart, are actually the same organism. If you can call a clump of 6,000-year-old cancer cells an organism.

These ancient cells were once part of a dog that roamed the frozen Siberian steppe, a husky-like creature that lived in the time before humans invented the wheel or the plow. Then they mutated, finding a way to evade the canine immune system, a way to outlive their body by finding another. This cancer-cum-sexually transmitted dog parasite still thrives today, the only remnant of that now-extinct Siberian dog race. For millennia, it has been jumping between bodies, spreading like a virus around the world. Canine transmissible venereal tumor, or CTVT, is now found in modern dogs from Malawi to Melbourne to Minneapolis. It’s the longest-lived cancer known to humans. But until now, no one had looked deeply into its DNA to trace its evolutionary origins and discover the secrets of its viral success.

For the past decade and a half, veterinarians from nearly every country on the planet have been gathering the material to do that—shaving off slices of these tumors as they’ve come across them, sealing them up in test tubes, and shipping them off to the laboratory of Elizabeth Murchison at the University of Cambridge, in the UK. Murchison is perhaps better known for her work investigating a different contagious cancer that nearly crashed the world’s population of Tasmanian devils.

Now her team has used their massive collection of dog tumor samples to create the first-ever genetic map of CTVT. Published today in Science, it not only traces these cells’ prolific colonization of human’s best friend, it also begins to unravel the mystery of the cancer’s bizarre evolutionary success, offering a glimpse of how humans might one day tame their own.

“Human tumors don’t have much time to evolve—years, maybe decades—so they exhibit very strong competition,” says Adrian Baez-Ortega, a PhD student in Murchison’s lab and the study’s lead author. Within a human tumor, different mutations create sub-groups of cells that compete with one another for survival. Blast it with chemotherapy, and any resistant cells will outlive the susceptible ones, allowing certain mutations to dominate the tumor.

This phenomenon is called selective sweeping, and it happens over and over in a tumor’s early life cycle to make it more and more aggressive. There are more than 200 known driver genes in humans, the genes that when mutated increase cancer cell fitness. In CTVT, though, Baez-Ortega’s team found only five such mutated driver genes, which arose very early in the cancer’s emergence. Possibly all of them were present in that first founder dog. “These are very common mutations in human cancer,” says Baez-Ortega. “None of them is very special. We didn’t find anything that indicates CTVT acquired transmissibility through evolution. It just emerged in the right time and place on the anatomy of the dog so it could secure a route of transmission.”

For a cancer to become contagious, it has to clear two serious barriers. First, the cancer cells themselves have to find a way to physically get from one individual to another. (This is different, to be clear, from infectious pathogens which can cause cancers, like HPV.) And second, the cells have to be able to evade the immune system of the new host once they get there. Tasmanian devils pass their cancer around through the violent face-biting that typifies their fierce mating rituals. Dogs spread theirs through sexual contact—the tumors grow on the animals’ organs and shed cells during the act.