Retroviruses are abundant in nature and include human immunodeficiency viruses (HIV-1 and -2) and human T-cell leukaemia viruses.
The findings on a specific group of viruses called ERV-Fc show that they affected a wide range of hosts, including species as diverse as carnivores, rodents and primates.
The distribution of ERV-Fc among these ancient mammals suggests the viruses spread to every continent except Antarctica and Australia, and that they jumped from one species to another more than 20 times.
Vast expanses of grasslands emerged around this time, along with large mammals as the world's predominate fauna.
More From This Section
"Viruses have been with us for billions of years, and exist everywhere that life is found. They therefore have a significant impact on the ecology and evolution of all organisms, from bacteria to humans," said Welkin Johnson, a professor at Boston College in US.
"Over the course of millions of years, however, viral genetic sequences accumulate in the DNA genomes of living organisms, including humans, and can serve as molecular 'fossils' for exploring the natural history of viruses and their hosts," he said.
Using such "fossil" remnants, researchers studied where and when these pathogens were found in the ancient world, which species they infected, and how they adapted to their mammalian hosts.
To do this, they first performed an exhaustive search of mammalian genome sequence databases for ERV-Fc loci and then compared the recovered sequences.
These sequences were then used to infer the natural history and evolutionary relationships of ERV-Fc-related viruses.
The studies also allowed the team to pinpoint patterns of evolutionary change in the genes of these viruses, reflecting their adaptation to different kinds of mammalian hosts.
The researchers also found that these viruses often exchanged genes with each other and with other viruses, suggesting that genetic recombination played a significant role in their evolutionary success.
The study was published in the journal eLife.