Coal mining company Alpha Natural Resources, Alpha Appalachian Holdings and 66 subsidiaries have agreed to pay a civil penalty of $27.5 million for thousands of permit violations. The fine is the largest penalty in history under Section 402 of the Clean Water Act (CWA), the U.S. Environmental Protections Agency (EPA) and the U.S. Department of Justice announced.

The firms also agreed to implement an extensive upgrade program to cut water pollution from discharges at 79 mines and 25 processing facilities in five states. The companies will invest a total of $200 million to install wastewater treatment systems and other types of equipment that will reduce the harmful effect on waterways from coal mining operations. The five states that will benefit from the upgrades are Kentucky, Pennsylvania, Tennessee, Virginia and West Virginia.

The federal agency estimated that this comprehensive upgrade will result in a reduction of 36 million pounds per year in discharged dissolved solids and will reduce metal and other pollutant discharge by nine million pounds annually.

RELATED: New coal-related incident in West Virginia raises water safety questions

According to the EPA statement, Alpha and its subsidiaries repeatedly violated 336 permits between 2006 and 2013, discharging excess amounts of chemicals into rivers and streams. The EPA recorded at least 6,289 violations of permit limits at 794 different points of discharge. Pollutants detected in waterways near the mines include iron, total suspended solids, aluminum, manganese and selenium, among others.

“This settlement is the result of state and federal agencies working together to protect local communities from pollution by enforcing the law,” said Cynthia Giles, Assistant Administrator of EPA’s Office of Enforcement and Compliance Assurance. “By requiring reforms and a robust compliance program, we are helping to ensure coal mining in Appalachia follows environmental laws that protect public health.”