Malaria is one of several deadly diseases that has jumped the species barriers from animals into humans.

It kills almost half a million people per year, and can be transmitted into humans by a single mosquito bite.

The most deadly form of malaria is caused by the Plasmodium falciparum protozoan parasite, one of several malaria-causing parasites.

But mosquitoes are simply the carriers, not the source. This has made tracing the parasite's origin challenging.

In order to understand how a disease evolves, it is crucial to know where and when it began affecting humans. This can help scientists unpick the miniscule genetic changes that could have made it so deadly.

In 2010 scientists made a breakthrough. By analysing western gorilla faecal samples that contained Plasmodium parasites, they found the human version – P. falciparum – was closely related to one of the three Plasmodium parasites that gorillas host.

It was not clear when the gorilla parasite jumped into humans

It revealed, for the first time, that the deadliest form of human malaria came from gorillas, not chimps or other species of early-humans as others had previously proposed.

This is how it started: a mosquito bit an infected gorilla and then transmitted the parasite to a human with another bite. Once it was in humans it could then spread rapidly, as long as there were enough mosquitoes to pass the parasite from person to person.

But the story was still incomplete. In particular, it was not clear when the gorilla parasite jumped into humans.

The problem was that the faecal samples contained only snippets of the gorilla Plasmodium DNA. To get full genome sequences that would help pin down the time of transmission, the researchers needed blood.

Blood from wild gorillas is almost impossible to obtain. Fortunately chimpanzees also harbour three distinct Plasmodium species, and it is relatively easy to get blood from chimps living in sanctuaries in Cameroon, near to where wild chimps live.

The original jump into humans could have occurred as recently as 10,000 years ago

A new study in the journal Nature Communications has now obtained full genome sequences of two of the chimp parasites, to allow the researchers to look in more detail at the Plasmodium family tree.

This offered surprising clues into malaria's deadly origin.

The chimp parasites were 10 times more diverse than the human version, P. falciparum. This is revealing. "It changes our perspective on when [the original transmission] into humans might have happened," says co-author Paul Sharp of the University of Edinburgh in the UK.

The original jump into humans could have occurred as recently as 10,000 years ago, the research reveals.

This coincides with the time when humans started to form close settlements and develop agriculture. This meant they travelled less than their hunter-gatherer forebears, allowing mosquitoes ample chances to bite.

"People have speculated that P. falciparum has been in humans for hundreds of thousands of years," says Sharp. "What we can see in terms of the diversity of the human parasite, is that it must be something that happened over a relatively short timescale."

If it was older, the parasite would have had much more time to form new mutations and would show more genetic diversity.

A parasite has to replicate, then mutations are introduced and so on

"Finding these chimps have a lot more genetic diversity emphasises how little the human parasites have," he says.

This lack of diversity is what scientists refer to as a genetic "bottleneck". Gorilla and chimp Plasmodium species may have had millions of years to develop new mutations, while the fact that P. falciparum contains few mutations shows it only entered its human host relatively recently.

Generating genetic diversity takes time, says Beatrice Hahn at the University of Pennsylvania, US, another co-author of the study. "A parasite has to replicate, then mutations are introduced and so on."

The work also emphasised, as was first hinted in 2010, that the deadliest form of malaria caused by P. falciparum is the result of one single bite, thousands of years ago.

This is both surprising and somewhat reassuring. Even HIV has been transmitted into humans from apes several times. "Once something works, it usually works more than once, even if it was a rare event," says Hahn.

Nature isn't stupid

By that logic, we should have seen several transmissions of P. falciparum from gorillas into humans. After all, mosquitoes and humans are plentiful in areas where infected gorillas live.

And yet, this has not happened. None of the six known ape Plasmodium species are found in humans today.

It therefore remains a mystery how the original P. falciparum made the species jump.

The fact that it has not happened more often reveals that our in-built barriers – which normally prevent cross-species transmission – are working well most of the time. "There are innate restriction factors that usually prevent this," says Hahn. "Nature isn't stupid."

What must have happened is that certain genes from the gorilla Plasmodium strain adapted to their human hosts, once we were first infected, says David Conway of the London School of Hygiene & Tropical Medicine in the UK, who was not involved with the latest study.

The team has already been able to pinpoint two genes that could have helped the gorilla parasite invade human blood cells

"That enabled the original line to get started and thrive in humans and be [the] origin of [the] most serious malaria parasite today," he says.

The next step will be to analyse the blood of infected gorillas. Researchers may then be able to pinpoint the genes that could have made the parasite so deadly to humans.

We might then find a possible "switch that enabled the original P. falciparum to thrive in humans", says Conway.

In fact, the team has already been able to pinpoint two genes that could have helped the gorilla parasite invade human blood cells.

"We can't prove it but it's very tempting to speculate that this switching of a gene from one species into another species was part of the process that allowed this gorilla parasite to infect humans," says Sharp.

At the same time, Hahn hopes to find out more about any beneficial adaptations that apes and their ancestors evolved to combat malaria. They must have hosted Plasmodium parasites for many millions of years longer than humans, so they have had plenty of time to build up better resistance.

If she can figure out how the apes fight malaria, it may help us to understand why the parasite is so deadly in humans, which could in turn help prevent its further spread.

Melissa Hogenboom is BBC Earth's feature writer. She is @melissasuzanneh on Twitter.

Follow BBC Earth on Facebook, Twitter, and Instagram. If you liked this story, sign up for the weekly bbc.com features newsletter.