Prudential Insurance Co. has agreed to donate more than $20 million to veterans’ charities, and pay $8 million to survivors of veterans and service members who died, to settle a class action that alleged the insurance giant profited by not paying lump sum death benefits to the families.

On Aug. 5, U.S. District Judge Michael Ponsor of the District of Massachusetts approved the preliminary settlement in the hotly contested consolidated case In Re: Prudential, which also includes awards of about $10 million for plaintiffs’ attorneys and $10,000 each for 10 class representatives. Each primary beneficiary would receive about $125, the order estimates.