Former goldmine workers have won a $32 million settlement from South African mining giants Anglo American and AngloGold Ashanti over respiratory diseases contracted underground, lawyers said Friday.

The companies have agreed to the huge payout for a group of about 4,400 silicosis victims and their families, ending a three-year legal battle for compensation.

The claimants said they got silicosis, which has no known cure, from inhaling dangerous levels of while drilling rocks in goldmines.

Silica dust lodges in the lungs and causes permanent scars.

Symptoms include persistent coughing and shortness of breath, and the disease often leads to tuberculosis and death.

"A six-week trial had been scheduled in April," said Zanele Mbuyisa, a Johannesburg-based lawyer representing the miners.

"Based on the evidence amassed and the powerful support from an array of eminent experts, we were confident of winning."

She added that thousands of miners had died before receiving any compensation, despite their employers knowing the health risks.

The 4,365 former miners or their widows are now aged 61 on average, and most came from the poorest regions of South Africa and the kingdom of Lesotho.

The compensation follows a landmark case won by 23 claimants in 2013.

"This is a triumph for justice," said Richard Meeran of the London-based Leigh Day law firm.

"It will bring much needed financial relief to the victims and their families... and we hope, the necessary impetus for an industry-wide settlement for all gold mining silicosis victims."

South Africa is one of the world's leading gold-producing countries, and lax labour health and labour practices dating back to the apartheid-era contributed to the spread of mining-related diseases.

The two companies issued a statement confirming the settlement, adding they had made no admission of liability.

"AngloGold Ashanti believes that agreeing settlement terms is in the best interests of the claimants, their families, and the company," AngloGold Ashanti chief executive officer Srinivasan Venkatakrishnan said.

A separate class-action claim is being pursued through in the Johannesburg High Court.