On Thursday, Duke Energy was ordered to take immediate action to stop groundwater contamination from its 14 North Carolina facilities. State Judge Paul Ridgeway directed Duke to create a plan to clean up its leaking coal ash ponds and the areas they have contaminated.

All of Duke’s coal-fired power plants in North Carolina operate unlined, aging coal ash ponds, one of which is responsible for the massive coal ash spill last month in the Dan River. Thursday’s decision reverses a 2012 North Carolina Environmental Management Commission ruling that Duke should not be required to take urgent action to address coal ash pollution.

“The ruling leaves no doubt, Duke Energy is past due on its obligation to eliminate the sources of groundwater contamination, its unlined coal ash pits, and the State has both the authority and a duty to require action now,” D.J. Gerken, senior attorney at the Southern Environmental Law Center, said in a press release.

Gerken represented environmental groups that contested the 2012 ruling more than a year ago. According to the Southern Environmental Law Center, several years’ worth of data collected by the Department of Environment and Natural Resources (DENR) indicates that many of Duke’s facilities are causing groundwater contamination “by storing hazardous coal ash in unlined pits often adjacent to major bodies of water, including drinking water reservoirs.”

Most of the company’s coal ash ponds in North Carolina have been in operation for decades and were largely unregulated until 2008, when a dam burst at the TVA Kingston Fossil Plant causing the largest coal ash spill to date in the US. The spill caused by a leak beneath a coal ash pond at Duke’s Dan River facility last month is reportedly the nation’s third largest coal ash spill.

According to Waterkeeper Alliance, arsenic has been detected in the groundwater at the Dan River facility at “levels exceeding legal standards” since a sampling event in 2011. In mid-February, shortly after the spill, Waterkeeper Alliance reported that polluted water was still flowing into the river.

The group also alleges that DENR’s water samples after the Dan River spill, which claimed that levels of arsenic in the river were safe, did not match up with samples taken by Waterkeeper. Judge Ridgeway’s opinion states that arsenic, thallium, and sulfate have been found in groundwater samples from Duke’s facilities.

“If the state had exercised its authority to require cleanup of those ponds previously, the catastrophic February 2014 coal ash spill could have been prevented,” Pete Harrison, a staff attorney with Waterkeeper Alliance, said in a statement. “The time to use this authority to require cleanup at other plants around the state is now, before another disaster occurs.”

Alisha is a writer and researcher with Ring of Fire. You can follow her on Twitter @childoftheearth.