Kraft Foods Inc. will pay $8.1 million to settle a class-action lawsuit over pollution at a former factory in Attica, Ind.

A federal court approved the settlement Friday.

The lawsuit represents nearly 130 families who say the pollution from the factory contaminated the groundwater beneath their homes and spread cancer-causing vapors.

In addition to the payment to the families, Kraft will clean up the plant site, groundwater and install mitigation systems in the affected homes.

An attorney for the families says the agreement provides them much-needed relief. Kraft officials were not immediately available to comment.

Copyright 2011 The Associated Press.