The state of North Carolina says it has secured an agreement with Duke Energy to excavate nearly 80 million tons of coal ash at six facilities.

The Department of Environmental Quality said in a Thursday press release that it will be the largest coal ash cleanup in the nation’s history. It also settles various legal disputes between Duke and parties that include environmental and community groups.

For decades, coal ash has been stored in landfills or in ponds, often near waterways into which toxins can leach.

Duke Energy will remove coal ash from the Allen, Belews Creek, Cliffside, Marshall, Mayo and Roxboro sites into on-site lined landfills.

“This agreement is a historic cleanup of coal ash pollution in North Carolina, and the Department of Environmental Quality and community groups throughout the state have provided essential leadership in obtaining it,” said Southern Environmental Law Center senior attorney Frank Holleman in a written statement.

Stephen De May, North Carolina president of Duke Energy, said in a statement that the agreement “significantly reduces the cost to close our coal ash basins in the Carolinas for our customers, while delivering the same environmental benefits as full excavation.”

The issue of coal ash storage drew national attention following a spill in Tennessee in 2008. Cleanup became a priority in North Carolina after a 2014 leak from a Duke Energy site left coal ash coating 70 miles of the Dan River on the state’s border with Virginia.

Duke Energy pleaded guilty in 2015 to federal environmental crimes after an investigation found the company allowed coal ash dumps at five power plants to leak toxic waste into water supplies. The company agreed to pay $102 million in fines and restitution.

In 2018, Duke Energy agreed to pay a $156,000 penalty for similar state environmental violations at three other power plants after pollution entered groundwater and the adjoining Catawba and Broad rivers.

In April 2019, North Carolina ordered the energy company to excavate all coal ash deposits from its power plant sites. Duke Energy went on to contest the ruling, saying the state’s Department of Environmental Equality exceeded its authority.

One method of removing and storing coal ash has been partnership with counties to find spots deep in the ground for the ash. Duke Energy agreed to deals with Chatham and Lee Counties in 2015 to move coal ash into mines.

In Chapel Hill, coal ash has been a point of conversation because of a different deposit near the town’s police station and Bolin Creek. The town has been providing updates on the remediation of the land on its website.