South African gold producers reached a a class action settlement on with law firms representing thousands of miners who contracted the fatal lung diseases silicosis and tuberculosis, the lawyers said.

In their statement, the lawyers did not provide an amount but the companies have already said that they have set aside 5 billion rand ($395 million) in provisions for the settlement.

Reuters reported that sum has already been reflected in financial results and so it should not impact future earnings.

The companies involved are Harmony Gold, Gold Fields, African Rainbow Minerals, Sibanye-Stillwater, AngloGold Ashanti and Anglo American. The latter no longer has gold assets but historically was a bullion producer.

“The settlement is the product of commercial negotiation and compromise, but we believe this is a beneficial settlement,” said Carina du Toit, a lawyer with the Legal Resources Centre, one of the law groups representing the workers.