South African gold miners infected with lung diseases brought on by repeated exposure to the dust of the mines have won a multimillion dollar out-of-court settlement.

A lawyer representing 4,365 claimants affected by silicosis said Saturday that Anglo American South Africa and AngloGold Ashanti have agreed to pay the equivalent of $32,595,800.

Lawyer Zanele Mbuyisa, who said the case was settled out of court, has been working with human rights lawyers from the London-based firm Leigh Day since 2012, collecting the stories of miners in rural South Africa and neighboring Lesotho.

Mbuyisa said about 400 miners died before the settlement was reached.

The mining companies said the settlement was reached without an admission of liability from the operators and in the interest of the claimants and their families.