Two years after AngloGold Ashanti suspended production at its giant but loss-making gold mine in Obuasi, central Ghana, the boom of underground explosions has resumed.

Lacking any alternative in an area devastated by the mine's closure and the loss of thousands of jobs, hundreds of people broke into the site, dug shafts by hand and grew so bold in their quest for gold they started using explosives.

You can tell the whole story of the mining industry in Africa and in Ghana in particular through Obuasi

Earnings as high as 10,000 cedis ($2,600) a month from the illicitly mined gold mean people are willing to gamble with their lives.

"This work is risky work. Some people go there and on their first time they don't come back," said Barack Godspeed, 27, who says mining is his only option even though he has a science degree.

Obuasi's downturn highlights the pitfalls of Ghana's - and Africa's - dependence on its mineral sector and the question of how countries will adjust as natural resources start to dwindle.

For decades Obuasi and its 100-year-old mine attracted jobs and investment, to the envy of other towns. It even boasted a premier league football team, Ashanti Gold.

"None of us really considered that there could be a time when the mine is no more," said Kwabena Kwarteng, a local MP.

Metals, fuels and ores represent 60 percent of Africa's exports, the World Bank said in a recent report, making it vulnerable to global price swings. The recent slump has reduced average growth in oil-producing countries from 5.4 percent in 2014 to 2.9 percent last year.

Ghana's experience illustrates the problem. A boom that relied on exports of gold, cocoa and oil saw five years of sustained GDP growth at around 8 percent and lifted Ghana to official 'middle income' status.

Since 2014, however, growth has slowed sharply, coinciding with the commodities slump.

The government began following an aid deal with the International Monetary Fund last year to reduce its inflation, public debt and fiscal deficit.

"You can tell the whole story of the mining industry in Africa and in Ghana in particular through Obuasi," said Emmanuel Kuyole, Africa deputy director of the Natural Resource Governance Institute.

"There wasn't serious thinking about Obuasi beyond the mine and now the mine has nearly closed and the other investments aren't sustainable," he told Reuters.

Since the mine stopped producing, AngloGold has maintained social commitments including treating water, providing free power to some communities, building schools, donating medical equipment and running a malaria programme, according to Eric Asubonteng, managing director of AngloGold Ashanti Ghana.

But that help and payments to unemployed miners cannot sustain the local economy, residents and union officials said.

Benjamin Annan of the Association of Small Scale Miners in Obuasi said part of the problem was that farmland in the vast mine concession area was off limits or had been damaged, cutting off a potential source of employment.

Businessman Michael Mensah said trade at his shop, which sells tiles and plumbing equipment, had plummeted since the lay-offs. Even the football club is now in trouble.

Miner deaths

AngloGold officials say at least 25 illegal miners have died this year in accidents. The illegal shafts extend down up to 50 metres, stiffened with interlaced branches to prevent collapse. Miners descend with torches and tools and pass sacks of ore to the surface.

Those shafts now intersect with AngloGold's vast network of tunnels, allowing illegal miners to penetrate deeper.

Working in gangs, they have reached 2,100 feet in depth and use explosives to try and breach the thick concrete bulwarks erected by the company to prevent access to elevator shafts that lead straight down to the richest seams, company officials said.

Obuasi's ageing labyrinth of tunnels makes access to the remaining 9.5 million ounces of reserves uneconomic.

AngloGold is building a tunnel to allow trucks to drive from the surface to the deepest point but the illegal mining has halted the project and also deters potential investors.

"The best approach to getting things done sustainably ... is to ensure that the mine itself that is the core business is back on its feet in a proper way and ... the illegal mining ... is certainly not helping," said AngloGold's Asubonteng.

He also says the government failed to keep illegal miners out. The firm has sought arbitration with the Ghanaian government at the International Centre for Settlement of Investment Disputes in Washington.

"They (the government) are trying to get these guys out without losing one pint of blood," said Toni Aubynn, chief executive of the government's Ghana Minerals Commission.