A “perfect storm” of urban change that began in 1920s Kinshasa led to the catastrophic spread of HIV across Africa and into the wider world, according to scientists who used genetic sequencing and historical records to trace the origins of the pandemic.

Though the virus probably crossed from chimpanzees to humans in southern Cameroon years earlier, HIV remained a regional infection until it entered the capital of what is now the Democratic Republic of the Congo.

From the 1920s until 1960, the pandemic HIV strain – there were others that fizzled out – spread from Kinshasa, crossed borders to other nations, and ultimately landed on distant continents. It has infected nearly 75 million people worldwide to date.

When the virus arrived, Kinshasa was bustling. It was the largest and fastest growing city in the region with transport links reaching up and down the country. The busy Congo river curved north and east to Kisangani more than 600 miles away. The railway carried scores of workers southeast to Katanga, a mining province reliant on immigrant labour, and on to Lubumbashi more than 900 miles away.

Records show that by the 1940s, more than a million people a year passed through Kinshasa on the railways alone. By 1960, the rate of new pandemic HIV infections outpaced the growth of the regional population, according to research published in Science.

While boats and trains spread the virus far, other factors played their part. Records suggest Kinshasa had a relatively high proportion of men and a consequent demand for sex workers. Some doctors may have unwittingly spread the virus further, through unsterilised jabs at sexual health clinics.

An international team of scientists led by the universities of Oxford in Britain and Leuven in Belgium reconstructed the history of the HIV pandemic using historical records and DNA samples of the virus dating back to the late 1950s. The DNA allowed them to draw up a family tree of the virus that traced its ancestry through time and space. Using statistical models they could push farther back than the 1950s and locate the origin of the pandemic in 1920s Kinshasa.

People with HIV in central Africa at the time did not have specific symptoms that would have been written down in their medical records. The virus causes the immune system to collapse, leaving people open to all manner of infections. “For an epidemic like HIV where we’re trying to track back to before it was even discovered, genetics is the only source of information we have,” said Oliver Pybus, an evolutionary biologist at Oxford University and senior author on the study.

The genetic data suggests that pandemic HIV spread rapidly through the Democratic Republic of the Congo, a country the size of western Europe. From the late 1930s to the early 1950s, the virus spread by rail and river to Mbuji-Mayi and Lubumbashi in the south and Kisangani in the north. There the virus took hold and formed secondary reservoirs from where it spread to countries in southern and eastern Africa.

At first, HIV was an infection confined to specific groups of people. But the virus seemed to break out into the general population and spread around the world after what was then known as the Republic of the Congo achieved independence in 1960.

“Parts of the story can only be suggestive. Without a time machine it’s very difficult to prove causality. But we can be fairly sure we have the time and place where this happened,” Pybus said. “It seems a combination of factors in Kinshasa in the early 20th century created a perfect storm for the emergence of HIV, leading to a generalised epidemic with unstoppable momentum that unrolled across sub-Saharan Africa.”

Different strains of HIV have almost certainly jumped from apes to humans – through hunting or handling bushmeat – scores of times throughout history. Only a dozen or so incidents have left their traces in the DNA of HIV strains around today. Some outbreaks infected hundreds of thousands of people in Africa but went no further. Only one, known as HIV-1 group M, went pandemic.

“We all want to know how this happened, how we got here,” said Pybus. “We wanted to answer the question: why did this one turn into a pandemic?”