Modern humans may have been wiped out by flu if they had not mated with Neanderthals, a new study suggests.

Scientists at Stanford University have discovered that ancient trysts led to the swapping of important DNA which protected humans from diseases after they left Africa.

Neanderthals became extinct around 40,000 years ago, but most modern Europeans still carry about two percent of their DNA in their genomes.

The researchers found that the 152 genes we inherited from Neanderthals interact with modern day influenza A and hepatitis C, and helped our ancestors fend off the diseases when they encountered them.

“Our research shows that a substantial number of frequently occurring Neanderthal DNA snippets were adaptive for a very cool reason," said Dr Dmitri Petrov, an evolutionary biologist at Stanford's School of Humanities and Sciences.

"Neanderthal genes likely gave us some protection against viruses that our ancestors encountered when they left Africa."

When first contact occurred between the two species, Neanderthals had been living outside of Africa for hundreds of thousands of years, giving their immune systems ample time to evolve defenses against infectious viruses in Europe.

But our newly emigrated ancestors, by comparison, would have been much more vulnerable.