Media playback is unsupported on your device Media caption Rebecca Morelle reports from the drill site in Iceland

Geologists say they are close to creating the hottest borehole in the world.

They are drilling into the heart of a volcano in the south-west of Iceland.

They have told the BBC that they should reach 5km down, where temperatures are expected to exceed 500C (932F), in the next couple of weeks.

The researchers want to bring steam from the deep well back up to the surface to provide an important source of energy.

"We hope that this will open new doors for the geothermal industry globally to step into an era of more production," said Asgeir Margeirsson, CEO of the Iceland Deep Drilling Project (IDDP), a collaboration between scientists, industry and the Icelandic government.

"That’s the aim - that’s the hope. We have never been this deep before, we have never been into rock this hot before, but we are optimistic."

The project is located on the Reykjanes peninsula, where a volcano last erupted 700 years ago.

A huge rig stands out against the black lava fields; inside a drill has been operating for 24 hours a day since August.

It has now descended nearly 4,500m, and the team expects it to hit its target depth of 5km by the end of the year.

Gudmundur Omar Fridleifsson, from Icelandic energy company HS Orka, is the project's chief geologist.

Image copyright Alison Francis Image caption Steam from the deep well could provide an important source of energy

He shows me thin cores of black basalt rock that have been collected from deep beneath the ground.

"It’s getting hotter - and that's what we want," he said.

"We don’t expect to drill into magma, but we are drilling into hot rock. And by hot rock, we mean 400 to 500C."

Close to the rig, sulphurous steam is blasting from the ground, blending into the grey sky above.

Iceland, sitting on the boundary between two major tectonic plates, is one of the most volcanically active places in the world.

Harnessing this energy through geothermal technology is already well established here.

"In this area at Reykjanes, we typically drill to 2km or 3km depth to harness the steam, to run power plants and produce clean, renewable electricity," explained Asgeir Margeirsson.

"We want to see if the resources go deeper than that."

When the drill gets to 5km, the team expects to find molten rock mixed with water. But with the extreme heat and immense pressure found at this depth, the water becomes what is known as "supercritical steam".

It is neither a liquid nor a gas, but it holds far more energy than either. And it is this supercritical steam that the team wants to bring back up to the surface to convert into electricity.

Image copyright Rebecca Morelle Image caption Geologists collect thin cores of black basalt rock from deep underground

They believe its special properties mean it could produce up to 10 times as much energy as the steam from conventional geothermal wells.

Mr Margeirsson said: "If this works, in the future we would need to drill fewer wells to produce the same amount of energy, meaning we would touch less surface, which means less environmental impact and hopefully lower costs.

"But that is if this works. This is full-scale research and development - we don’t know what the outcome will be."

And there is a good reason to be cautious. With volcanoes, expect the unexpected.

In 2009, the IDDP team attempted to drill deep down into another volcanic site. But at 2,100m, they accidentally hit a shallow reservoir of magma.

Footage on the internet shows black smoke billowing from the well - and the drill was destroyed. So is it really a good idea to tamper with these complex and destructive forces of nature?

Simon Redfern, professor of mineral physics at the University of Cambridge, told the BBC: "I think the risks are rather minor. The likelihood is that there will be natural eruptions before any that are generated by human activity."

Image caption If the effort works, it might mean fewer wells will need to be drilled to produce the same amount of energy

If the drill does hit magma, because it is under pressure, it would be likely to come to the surface rapidly, he explained.

"It would come out rather like lancing a boil or popping a spot. It would cause huge problems for the drilling operation itself, but it is unlikely to cause anything more significant than that."

Despite Iceland having more than 300 volcanoes, Prof Freysteinn Sigmundsson, a volcanologist at the University of Iceland, says there is still much to learn about them.

"We have many models of what the interior of a volcano looks like, but actually most of these models of active volcanoes are based on indirect observations," he explained.

"We can see seismic waves pass through them, or we can do some geophysical exploration, or we can study ground deformation.

"But actually, we have very few in situ measurements of what the interior of a volcano looks like."

This drilling project, however, would give geologists a unique vantage point, he said.

"There is always some risk... but there is also a risk if we don't do projects like this.

"By this project I think we can really make fundamental discoveries about how volcanoes work, and learn about their properties and conditions - and when magma could erupt to the surface."

The IDDP team says it is currently "drilling blind", which means no rocky debris is coming back up to the surface. Instead, it is somehow being absorbed into the surrounding rocks.

And without being able to examine the rock, it means the geologists really are heading into the unknown.

However, with only a few hundred metres to go, they are optimistic that the world's hottest borehole is now within their sights.

The IDDP project is funded by energy companies (HS Orka, Statoil, Landsvirkjun and Orkuveita Reykjavíkur), Orkustofnun (the National Energy Authority of Iceland), the International Continental Scientific Drilling Program (ICDP), the National Science Foundation in the US and EU Horizon 2020.

Follow Rebecca on Twitter.