Thirty-four years ago, doctors in Los Angeles discovered that some of their patients were succumbing to a normally harmless fungus. It soon became clear that they belonged to a growing number of people whose immune systems were hobbled by a virus, eventually known as human immunodeficiency virus, or H.I.V.
To date, an estimated 78 million people have become infected, 39 million of whom have died.
As the true scale of the virus’s devastation began to emerge, a number of scientists set out to investigate its origins. Piece by piece, year after year, the scientists reconstructed its history. Their research slowly revealed that the virus did not make a single leap from animals, but several.
On Monday, a team of researchers filled in the final gaps in the history. It’s now clear, they say, that the virus originated in humans on 13 separate occasions, evolving in humans from ancestral viruses that infected monkeys, chimpanzees and gorillas.
“We’ve got an amazing amount of the story nailed down, more than any reasonable person could have expected in the 1980s,” said Michael Worobey, a professor of ecology and evolutionary biology at the University of Arizona, who was not involved in the new study.
The first clue to the evolution of H.I.V. emerged in 1985, when scientists discovered a virus in macaque monkeys that was closely related to H.I.V. As it turned out, forty African primate species harbored H.I.V.-like viruses, called simian immunodeficiency viruses, or S.I.V. It became clear that H.I.V. had evolved from an S.I.V. ancestor.
But looking for H.I.V.’s precise origins proved a difficult task.
The virus consists of two major types. H.I.V.-1, the most common, has spread worldwide, while H.I.V.-2 is found only in parts of western Africa. In 1991, scientists discovered that a strain of S.I.V. in certain African monkeys, called sooty mangabeys, was more closely related to H.I.V.-2 than H.I.V.-1.
Different S.I.V. viruses in sooty mangabeys were closely related to different strains of H.I.V.-2, researchers found. They eventually concluded that S.I.V. had jumped nine times from sooty mangabeys into humans, evolving into a strain of H.I.V.-2 each time.
Other researchers focused their attention on the origins of H.I.V.-1. In 1989, Dr. Martine Peeters, a virologist at the Institute of Research for Development and the University of Montpellier in France and her colleagues discovered similar viruses in chimpanzees in Gabon. To see how widespread these viruses were, the researchers surveyed chimpanzees in the wild by gathering their feces and extracting viral genes.
Chimpanzees are infected with a wide diversity of S.I.V. viruses, they found, and probably had been for tens of thousands of years — perhaps because at some point, some of them ate an infected monkey.
Most of the strains of S.I.V. in chimpanzees turned out not to be close relatives of H.I.V.-1, the scientists found. But in Cameroon, Dr. Peeters and her colleagues found close genetic matches between chimp S.I.V. and H.I.V.-1.
Scientists have divided H.I.V.-1 into four groups. Group M — short for main — is responsible for 90 percent of H.I.V.-1 infections. The other three groups — known as N, O, P — are rarer. Dr. Peeters and her colleagues found a strain of chimpanzee S.I.V. in Cameroon that was the source of H.I.V.-1 Group M. Another strain from the same population of apes gave rise to Group N.
But nobody knew where Group O and Group P came from.
On their expeditions, Dr. Peeters and her colleagues collected feces from other primates, hoping to find new kinds of S.I.V. In 2006, their search yielded a big surprise: The first S.I.V. known to infect gorillas.
Dr. Peeters and her colleagues discovered that gorilla S.I.V. was closely related to a strain of Cameroon chimpanzee S.I.V. That suggested that the gorillas got S.I.V. from the chimps.
The scientists searched for the virus in over 3,000 samples of gorilla feces from a number of African countries but failed to find any with S.I.V. outside of Cameroon. In that country, however, they found even more infected gorillas, which carried new strains of S.I.V.
Dr. Peeters and her colleagues reported their findings in the Proceedings of the National Academy of Sciences.
The new viruses allowed the scientists to definitively reconstruct the history of gorilla S.I.V. Gorillas acquired the virus only once from chimpanzees at some point in the past. Then, on two occasions, gorilla S.I.V. was acquired by humans — in one instance, producing H.I.V.-1 Group O, and in the other Group P.
Group P is the rarest form of H.I.V. The virus has been discovered in only two people, both from Cameroon. Evolutionarily, this adaptation appears to have been a failed experiment, producing a virus that does a bad job of infecting humans.
Group O is a different story. Dr. Peeters and her colleagues estimate that the virus has infected 100,000 people in Cameroon. And it has been around for a long time: The earliest documented case of a European becoming infected with H.I.V. involved a Norwegian sailor who fell in the mid-1960s.
So why did the chimpanzee S.I.V. lead to a worldwide epidemic, while S.I.V. from gorillas morphed into a human virus that remained in one small country?
Dr. Peeters and her colleagues think it was a matter of luck. Both H.I.V.-1 Group M and Group O jumped from apes to humans in the early 1900s, most likely by infecting hunters who killed the animals for meat.
Both viruses then adapted to their new hosts. The human immune system can stop viruses like H.I.V. with a protein called tetherin, which links newly made viruses to the cell in which they formed. The “tethered” viruses are unable to escape to infect a new cell.
In their new study, Dr. Peeters and her colleagues found that the chimpanzee and gorilla viruses evolved different strategies for attacking tetherin. But only one got an excellent opportunity to spread.
In the mid-1900s, someone infected with H.I.V.-1 Group M traveled from Cameroon to the rapidly growing city of Leopoldville, now Kinshasa in the Democratic Republic of Congo. The virus found the perfect conditions in which to thrive.
“M got into Kinshasa and went boom,” said Beatrice H. Hahn, a co-author of the new paper and a microbiologist at the University of Pennsylvania. “If the O group had similar chances, we might have had a second epidemic.”