(Reuters) - A North Carolina judge ruled on Thursday that Duke Energy Corp must immediately stop the sources of groundwater pollution at its 14 coal-fired power plants in the state.

The issue of pollution from coal ash gained momentum in North Carolina last month, when a spill from a retired Duke power plant dumped at least 30,000 tons of ash in the Dan River.

In the ruling, Wake County Superior Court Judge Paul Ridgeway reversed a decision by the North Carolina Environmental Management Commission. He said the panel failed to apply state law properly when it did not force the utility to clean up its coal ash ponds.

The appeal of the commission's decision was brought in 2012 by a consortium of environmental groups, including the Cape Fear River Watch and the Sierra Club.

Duke, the biggest U.S. electric power provider, could appeal the ruling. In a statement, it said, "We're considering this ruling as we take another look at our management of coal ash basins."

At issue was whether the commission had the authority to force Duke to take immediate action to clean up the coal ash ponds.

"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," D.J. Gerken, an attorney with the Southern Environmental Law Center who represented the conservation groups in the case, said in a statement.

"The state has both the authority and a duty to require action now," he said.

Federal prosecutors have issued subpoenas to employees of Duke and the state Department of Environment and Natural Resources as part of a widening probe into possible felony violations at the 14 coal ash sites.

The North Carolina court decision came a day after Alpha Natural Resources Inc said it would spend $200 million to settle a dispute with the U.S. government over pollution discharged by coal mines.