Throughout history, humans have existed side-by-side with bacteria and viruses. From the bubonic plague to smallpox, we have evolved to resist them, and in response they have developed new ways of infecting us.

We have had antibiotics for almost a century, ever since Alexander Fleming discovered penicillin. In response, bacteria have responded by evolving antibiotic resistance. The battle is endless: because we spend so much time with pathogens, we sometimes develop a kind of natural stalemate.

However, what would happen if we were suddenly exposed to deadly bacteria and viruses that have been absent for thousands of years, or that we have never met before?

We may be about to find out. Climate change is melting permafrost soils that have been frozen for thousands of years, and as the soils melt they are releasing ancient viruses and bacteria that, having lain dormant, are springing back to life.

In August 2016, in a remote corner of Siberian tundra called the Yamal Peninsula in the Arctic Circle, a 12-year-old boy died and at least twenty people were hospitalised after being infected by anthrax.

The theory is that, over 75 years ago, a reindeer infected with anthrax died and its frozen carcass became trapped under a layer of frozen soil, known as permafrost. There it stayed until a heatwave in the summer of 2016, when the permafrost thawed.

This exposed the reindeer corpse and released infectious anthrax into nearby water and soil, and then into the food supply. More than 2,000 reindeer grazing nearby became infected, which then led to the small number of human cases.

The fear is that this will not be an isolated case.

As the Earth warms, more permafrost will melt. Under normal circumstances, superficial permafrost layers about 50cm deep melt every summer. But now global warming is gradually exposing older permafrost layers.

Frozen permafrost soil is the perfect place for bacteria to remain alive for very long periods of time, perhaps as long as a million years. That means melting ice could potentially open a Pandora's box of diseases.

The temperature in the Arctic Circle is rising quickly, about three times faster than in the rest of the world. As the ice and permafrost melt, other infectious agents may be released.

"Permafrost is a very good preserver of microbes and viruses, because it is cold, there is no oxygen, and it is dark," says evolutionary biologist Jean-Michel Claverie at Aix-Marseille University in France. "Pathogenic viruses that can infect humans or animals might be preserved in old permafrost layers, including some that have caused global epidemics in the past."

In the early 20th Century alone, more than a million reindeer died from anthrax. It is not easy to dig deep graves, so most of these carcasses are buried close to the surface, scattered among 7,000 burial grounds in northern Russia.

However, the big fear is what else is lurking beneath the frozen soil.

People and animals have been buried in permafrost for centuries, so it is conceivable that other infectious agents could be unleashed. For instance, scientists have discovered fragments of RNA from the 1918 Spanish flu virus in corpses buried in mass graves in Alaska's tundra. Smallpox and the bubonic plague are also likely buried in Siberia.

In a 2011 study, Boris Revich and Marina Podolnaya wrote: "As a consequence of permafrost melting, the vectors of deadly infections of the 18th and 19th Centuries may come back, especially near the cemeteries where the victims of these infections were buried."

NASA scientists successfully revived bacteria that had been encased in a frozen pond in Alaska for 32,000 years

For instance, in the 1890s there was a major epidemic of smallpox in Siberia. One town lost up to 40% of its population. Their bodies were buried under the upper layer of permafrost on the banks of the Kolyma River. 120 years later, Kolyma's floodwaters have started eroding the banks, and the melting of the permafrost has speeded up this erosion process.

In a project that began in the 1990s, scientists from the State Research Center of Virology and Biotechnology in Novosibirsk have tested the remains of Stone Age people that had been found in southern Siberia, in the region of Gorny Altai. They have also tested samples from the corpses of men who had died during viral epidemics in the 19th Century and were buried in the Russian permafrost.

The researchers say they have found bodies with sores characteristic of the marks left by smallpox. While they did not find the smallpox virus itself, they have detected fragments of its DNA.

Certainly it is not the first time that bacteria frozen in ice have come back to life.

In a 2005 study, NASA scientists successfully revived bacteria that had been encased in a frozen pond in Alaska for 32,000 years. The microbes, called Carnobacterium pleistocenium, had been frozen since the Pleistocene period, when woolly mammoths still roamed the Earth. Once the ice melted, they began swimming around, seemingly unaffected.

Once they were revived, the viruses quickly became infectious

Two years later, scientists managed to revive an 8-million-year-old bacterium that had been lying dormant in ice, beneath the surface of a glacier in the Beacon and Mullins valleys of Antarctica. In the same study, bacteria were also revived from ice that was over 100,000 years old.

However, not all bacteria can come back to life after being frozen in permafrost. Anthrax bacteria can do so because they form spores, which are extremely hardy and can survive frozen for longer than a century.

Other bacteria that can form spores, and so could survive in permafrost, include tetanus and Clostridium botulinum, the pathogen responsible for botulism: a rare illness that can cause paralysis and even prove fatal. Some fungi can also survive in permafrost for a long time.

Some viruses can also survive for lengthy periods.

In a 2014 study, a team led by Claverie revived two viruses that had been trapped in Siberian permafrost for 30,000 years. Known as Pithovirus sibericum and Mollivirus sibericum, they are both "giant viruses", because unlike most viruses they are so big they can be seen under a regular microscope. They were discovered 100ft underground in coastal tundra.

Once they were revived, the viruses quickly became infectious. Fortunately for us, these particular viruses only infect single-celled amoebas. Still, the study suggests that other viruses, which really could infect humans, might be revived in the same way.

The giant viruses tend to be very tough and almost impossible to break open

What's more, global warming does not have to directly melt permafrost to pose a threat. Because the Arctic sea ice is melting, the north shore of Siberia has become more easily accessible by sea. As a result, industrial exploitation, including mining for gold and minerals, and drilling for oil and natural gas, is now becoming profitable.

"At the moment, these regions are deserted and the deep permafrost layers are left alone," says Claverie. "However, these ancient layers could be exposed by the digging involved in mining and drilling operations. If viable virions are still there, this could spell disaster."

Giant viruses may be the most likely culprits for any such viral outbreak.

"Most viruses are rapidly inactivated outside host cells, due to light, desiccation, or spontaneous biochemical degradation," says Claverie. "For instance, if their DNA is damaged beyond possible repair, the virions will no longer be infectious. However, among known viruses, the giant viruses tend to be very tough and almost impossible to break open."

Claverie says viruses from the very first humans to populate the Arctic could emerge. We could even see viruses from long-extinct hominin species like Neanderthals and Denisovans, both of which settled in Siberia and were riddled with various viral diseases. Remains of Neanderthals from 30-40,000 years ago have been spotted in Russia. Human populations have lived there, sickened and died for thousands of years.

NASA scientists found 10-50,000-year-old microbes inside crystals in a Mexican mine

"The possibility that we could catch a virus from a long-extinct Neanderthal suggests that the idea that a virus could be 'eradicated' from the planet is wrong, and gives us a false sense of security," says Claverie. "This is why stocks of vaccine should be kept, just in case."

Since 2014, Claverie has been analysing the DNA content of permafrost layers, searching for the genetic signature of viruses and bacteria that could infect humans. He has found evidence of many bacteria that are probably dangerous to humans. The bacteria have DNA that encodes virulence factors: molecules that pathogenic bacteria and viruses produce, which increase their ability to infect a host.

Claverie's team has also found a few DNA sequences that seem to come from viruses, including herpes. However, they have not as yet found any trace of smallpox. For obvious reasons, they have not attempted to revive any of the pathogens.

It now seems that pathogens cut off from humans will emerge from other places too, not just ice or permafrost.

In February 2017, NASA scientists announced that they had found 10-50,000-year-old microbes inside crystals in a Mexican mine.

The bacteria have somehow become resistant to 18 types of antibiotics

The bacteria were located in the Cave of the Crystals, part of a mine in Naica in northern Mexico. The cave contains many milky-white crystals of the mineral selenite, which formed over hundreds of thousands of years.

The bacteria were trapped inside small, fluid pockets of the crystals, but once they were removed they revived and began multiplying. The microbes are genetically unique and may well be new species, but the researchers are yet to publish their work.

Even older bacteria have been found in the Lechuguilla Cave in New Mexico, 1,000ft underground. These microbes have not seen the surface for over 4 million years.

The cave never sees sunlight, and it is so isolated that it takes about 10,000 years for water from the surface to get into the cave.

Antibiotic resistance has been around for millions or even billions of years

Despite this, the bacteria have somehow become resistant to 18 types of antibiotics, including drugs considered to be a "last resort" for fighting infections. In a study published in December 2016, researchers found that the bacteria, known as Paenibacillus sp. LC231, was resistant to 70% of antibiotics and was able to totally inactivate many of them.

As the bacteria have remained completely isolated in the cave for four million years, they have not come into contact with people or the antibiotic drugs used to treat human infections. That means its antibiotic resistance must have arisen in some other way.

The scientists involved believe that the bacteria, which does not harm humans, is one of many that have naturally evolved resistance to antibiotics. This suggests that antibiotic resistance has been around for millions or even billions of years.

Obviously, such ancient antibiotic resistance cannot have evolved in the clinic as a result of antibiotic use.

The reason for this is that many types of fungi, and even other bacteria, naturally produce antibiotics to gain a competitive advantage over other microbes. That is how Fleming first discovered penicillin: bacteria in a petri dish died after one became contaminated with an antibiotic-excreting mould.

As Earth warms northern countries will become more susceptible to outbreaks of "southern" diseases like malaria

In caves, where there is little food, organisms must be ruthless if they are to survive. Bacteria like Paenibacillus may have had to evolve antibiotic resistance in order to avoid being killed by rival organisms.

This would explain why the bacteria are only resistant to natural antibiotics, which come from bacteria and fungi, and make up about 99.9% of all the antibiotics we use. The bacteria have never come across man-made antibiotics, so do not have a resistance to them.

"Our work, and the work of others, suggests that antibiotic resistance is not a novel concept," says microbiologist Hazel Barton of the University of Akron, Ohio, who led the study. "Our organisms have been isolated from surface species from 4-7 million years, yet the resistance that they have is genetically identical to that found in surface species. This means that these genes are at least that old, and didn't emerge from the human use of antibiotics for treatment."

Although Paenibacillus itself is not harmful to humans, it could in theory pass on its antibiotic resistance to other pathogens. However, as it is isolated beneath 400m of rock, this seems unlikely.

Nevertheless, natural antibiotic resistance is probably so prevalent that many of the bacteria emerging from melting permafrost may already have it. In line with that, in a 2011 study scientists extracted DNA from bacteria found in 30,000-year-old permafrost in the Beringian region between Russia and Canada. They found genes encoding resistance to beta-lactam, tetracycline and glycopeptide antibiotics.

How much should we be concerned about all this?

One argument is that the risk from permafrost pathogens is inherently unknowable, so they should not overtly concern us. Instead, we should focus on more established threats from climate change. For instance, as Earth warms northern countries will become more susceptible to outbreaks of "southern" diseases like malaria, cholera and dengue fever, as these pathogens thrive at warmer temperatures.

The alternative perspective is that we should not ignore risks just because we cannot quantify them.

"Following our work and that of others, there is now a non-zero probability that pathogenic microbes could be revived, and infect us," says Claverie. "How likely that is is not known, but it's a possibility. It could be bacteria that are curable with antibiotics, or resistant bacteria, or a virus. If the pathogen hasn't been in contact with humans for a long time, then our immune system would not be prepared. So yes, that could be dangerous."