South Africa gave the green light today for class action suits seeking damages from gold companies for up to half a million miners who contracted the fatal lung diseases silicosis and tuberculosis.

The High Court decision sets the stage for protracted proceedings covering cases dating back decades in the largest class action suits yet in Africa's most industrialised country.

In their 1980s heyday, South Africa's gold mines employed half a million men and High Court Judge Phineas Mojapelo judge said anywhere from 17,000 to 500,000 miners had been affected.

"We hold the view that in the context of this case, class action is the only realistic option through which most mine workers can assert their claims effectively against the mining companies," Judge Mojapelo said in a unanimous ruling by three judges.

"Mining companies will be held liable or responsible for their own actions for unlawful emissions," he said.

A paper by researchers at University of the Witswatersrand in Johannesburg and University College London estimated there were 288,000 cases of compensable silicosis in South Africa.

The 2009 paper put the industry's unpaid compensation liability at 10 billion rand ($583m) on 1998 values.

Silicosis is an incurable disease caused by inhaling silica dust from gold-bearing rocks. It causes shortness of breath, a persistent cough and chest pains, and also makes people highly susceptible to tuberculosis.

Activists sang and danced outside the courthouse after the ruling while miners walked out triumphantly with fists raised.

"This will make a difference in our lives, because we have been struggling for so long," said Vuyani Dwadube, 74, a former rock driller at Harmony Gold who has TB.

Judge Mojapelo said workers who had died of the diseases could be included in the suits, with any damages paid to family members, and that each mining company should be held liable separately for any damages.

While most of the miners are South Africans, thousands also came from neighbouring countries such as Lesotho, Malawi and Swaziland.

Mantso Mokwena, 53, a former worker at Sibanye Gold's Beatrix mine, owned by Gold Fields until 2013, said the outcome gave miners some closure.

"I contracted TB in 2007 but I was terminated from my job in 2009. Since then, I still don't have a job," he said.

The defendants include some of the world's biggest bullion producers, who have already been hit by a slide in commodities prices and widespread labour unrest among miners.

Anglo American, Africa's top gold producer Anglo Gold Ashanti, Gold Fields, Harmony Gold, Sibanye Gold and African Rainbow Minerals have formed the Occupational Lung Disease (OLD) group to deal with such issues.

Shares in the companies were mixed, with some tracking a stronger gold price. Anglo and ARM no longer operate gold mines but have been named in claims dating back to when they did.

"Certainly it will have an effect on their reserves. Most of them probably made provisions," Gryphon Asset Management Chief Investment Officer Abri du Plessis said.

"It's still too early to say what it will be (the damages) but it does create a lot of uncertainty and that is never good for share prices," he said.