Chemical manufacturer 3M will begin payments starting in the third quarter to many U.S. public drinking water systems as part of a multi-billion-dollar settlement over contamination with potentially harmful compounds used in firefighting foam and several consumer products, the company said.

St. Paul, Minnesota-based 3M announced Monday that last year’s lawsuit settlement received final approval from the U.S. District Court in Charleston, South Carolina.

The agreement called for payouts through 2036. Depending on what additional contamination is found, the amount paid out will range from $10.5 billion to $12.5 billion.

The deal compensates water providers for pollution with per- and polyfluorinated substances, known collectively as PFAS — a broad class of chemicals used in nonstick, water- and grease-resistant products such as clothing and cookware.