As Duke Energy pleaded guilty Thursday in a North Carolina courtroom to nine criminal violations of the federal Clean Water Act, federal prosecutors recounted examples where time and again the nation's largest electricity company failed to prevent its illegal pollution.

Two years before the massive February 2014 spill at a Duke ash dump in Eden coated 70 miles of the Dan River in gray sludge, engineers at the plant twice requested $20,000 from company headquarters to use a robotic camera to inspect aging drainage pipes, including the one that later collapsed, triggering the disaster.

Prosecutors said Duke executives denied the request both times, even after a top manager at the plant personally pleaded for the money to inspect the pipes.

"They should have been monitoring better, they should have been fixing what they saw, they should have been listening to their employees," said Assistant Attorney General John C. Cruden, who supervises the prosecution of environmental crimes at the U.S. Justice Department. "If they had done that, the spill we saw would not have occurred."

As part of a negotiated settlement with federal prosecutors, Duke agreed to pay $68 million in fines and $34 million on environmental projects and land conservation that will benefit rivers and wetlands in North Carolina and Virginia.

U.S. District Court Judge Malcolm Howard said it is the largest federal criminal fine in North Carolina history.

The judge also sentenced Duke to five years' probation. Under the terms, the company will be monitored for compliance with the Clean Water Act. If it violates the law while on probation, Duke could be subject to further action by the court.

The sentencing came after prosecutors told Howard that Duke ignored repeated warnings about problems at its coal ash pits. The ash, which is the waste left behind when coal is burned to generate electricity, contains such toxic heavy metals as arsenic, selenium, chromium and mercury

Duke admitted guilt to environmental violations at its coal-fired power plants in Eden, Moncure, Asheville, Goldsboro and Mount Holly.

Prosecutors said that Duke's illegal pollution had been going on as far back as 2010.

At the Moncure plant, employees informed supervisors in 2011 that a riser pipe that drained the basin was leaking, but no action was taken for two years, prosecutors said. As a result, Duke was criminally negligent in properly maintaining essential equipment. In another example, Duke illegally channeled contaminated wastewater seeping from its Asheville dump into the French Broad River.

Holding the company's plea agreement in his hand, Howard went through each charge and asked if the company had engaged in these illegal actions. Julia Janson, the company's chief legal officer, replied yes.

Then the judge asked how Duke was pleading to each count. And each time, she replied softly, "Guilty."

Janson later apologized on behalf of the company, conceding Duke's past conduct had "fallen short of our own high expectations."

Duke has said in statements and court filings that the costs of the settlement will be borne by its shareholders, not passed on to its electricity customers.

In a statement, the $50 billion Charlotte-based company said the settlement "closes a chapter in the company's history."

"We've used the Dan River incident as an opportunity to set a new, industry-leading standard for the management of coal ash," the release said.

Environmental groups hailed the resolution of the criminal charges a vindication for their years of efforts to get regulators to hold Duke accountable for the pollution leaking from 32 coal ash dumps at 14 power plants scattered across the state.

The Associated Press reported last year that environmental groups tried three times in 2013 to sue Duke under the Clean Water Act to force the company to clean up its leaky coal ash dumps. The groups said they were forced to sue after North Carolina regulators failed to act on evidence conservationists gathered of ongoing groundwater contamination at Duke's dumps.

But each time, the North Carolina Department of Environment and Natural Resources blocked the citizen lawsuits by intervening at the last minute to assert its own authority under the act to take enforcement action in state court.

The administration of Gov. Pat McCrory, a Republican who worked at Duke for 29 years, then proposed what environmentalists derided as a "sweetheart deal" under which Duke would have paid fines of just $99,111 to settle violations over toxic groundwater leeching from two of its plants. That agreement, which included no requirement that Duke immediately stop or clean up the pollution, was pulled amid intense criticism after the Feb. 2 spill.

In the wake of Dan River, state legislators passed a law requiring Duke to close and cap all of 32 ash dumps by 2029.

McCrory spokesman Josh Ellis said the governor has taken strong action on the issue.

"We've taken more enforcement action on coal ash than any administration in state history, begun implementing the toughest coal ash law in the nation and issued the largest fine in state history," he said in an email.

That $25 million state fine over violations at the L.V. Sutton Steam Plant near Wilmington is currently under appeal by Duke.