The Chester County district attorney and Sunoco Pipeline LP have reached a civil settlement that requires Sunoco to make no more mistakes in laying the Mariner East pipeline — such as the discharge of mud — or risk punishment in Chester County court.

Sunoco Pipeline, which is owned by Energy Transfer LP, signed a consent decree that establishes Chester County oversight of future environmental violations, Deborah Ryan, the district attorney, announced. The consent decree requires Sunoco to abide by all laws and permits and not create public nuisances under the Pennsylvania Clean Streams Law.

Though Sunoco voluntarily signed the agreement, the company admitted no wrongdoing, paid no fines, and said the “nuisance” issues cited by the district had been resolved long ago.

The consent decree is the outcome of threats made in 2019 by Ryan’s predecessor, Thomas P. Hogan. He said he would file a civil nuisance action against Energy Transfer unless the company corrected such problems as “inadvertent returns” of drilling mud during the pipeline’s construction.

Seth Weber, a former federal prosecutor hired as special Chester County prosecutor in 2019 to look into Sunoco’s troubled construction of the cross-state project, praised the decree. He said it would give the county an additional tool to press the firm.

“We’re asking for a change in their conduct and if they violate their permits or the environmental laws, that they would be held accountable in a court of law,” Weber said. About 23 miles of the Mariner East system cross Chester County, but it is among the most densely populated parts of the 350-mile system.

The county did not seek money damages from Sunoco, which has already paid the state about $16 million in penalties for the $5.1 billion project. Though some pipelines have been carrying natural gas liquids since 2014, completion of the project is four years behind schedule. The pipelines are to end at an export terminal in Marcus Hook.

“This lawsuit does not seek to stop the pipeline or suspend the pipeline,” Weber said. “It just seeks to hold the parties accountable for their actions in the installation, drilling and other activities in connection with the pipeline. They have now agreed to be subjected to the jurisdiction of the Chester County court if they violate it.”

The complaint cited a rash of problems Sunoco has experienced in Chester County with construction of the three Mariner East pipelines, including the most recent incident, a discharge of drilling fluids last August upstream from Marsh Creek Lake in Upper Uwchlan Township. State regulators forced Sunoco to halt construction at that location, and the company this month filed plans to modify its construction method near Marsh Creek to avoid additional incidents.

A Sunoco spokeswoman on Thursday said it cooperated with the DA’s investigation, but called the allegations “historical events” that were previously addressed by the Pennsylvania Department of Environmental Protection.

“Defendants specifically deny all factual allegations and legal conclusions contained in this consent decree, and further deny liability for any claims that the Chester County District Attorney’s Office may have against defendants in connection with the Mariner East pipeline system,” the 19-page pact says.

The agreement requires Sunoco to hire an independent auditor who will file a report every six months with the district attorney, outlining the company’s performance. The report will be confidential because it may contain privileged information about the project, but the district attorney can use the information to bring any actions against Sunoco for noncompliance.