(Bloomberg) — Enbridge Inc. will spend $172 million paying fines and boosting safety across its pipeline operations in a deal with the Justice Department resolving Clean Water Act violations connected to its 2010 oil spill near Marshall, Mich.

The settlement agreement announced Wednesday resolves the biggest lingering legal questions over the failure of Enbridge’s Line 6B, which sent more than 20,000 barrels of oil gushing into a Kalamazoo River tributary when it ruptured six years ago. The incident became one of the largest inland spills in U.S. history and stoked concerns about the safety of pipelines moving heavy Canadian crude across the border.

Under the settlement, Enbridge agreed to pay $62 million for violating the Clean Water Act, the largest fine for a pipeline spill ever under that law. The company also will spend at least $110 million taking steps to improve operations and prevent spills across its Lakehead pipeline system spanning 2,000 miles near the Great Lakes. Enbridge is required under the deal to replace nearly 300 miles of one of the pipelines, and is agreeing to pay over $5.4 million to reimburse the government for cleanup costs.

"This settlement will make the delivery of our nation’s energy resources safer and more environmentally responsible," Assistant Attorney General John C. Cruden said in a news release. "It requires Enbridge to take robust measures to improve the maintenance and monitoring of its Lakehead pipeline system, protecting lakes, rivers, land and communities across the upper Midwest."

Biggest Pipeline Fine

It is the second-largest Clean Water Act fine in a settlement, behind only those penalties levied in connection with the 2010 Deepwater Horizon disaster in the Gulf of Mexico, according to the Justice Department. Previously, the biggest Clean Water Act fine tied to a pipeline spill was a $34 million penalty against Colonial Pipeline Co. in 2003, according to the Environmental Protection Agency.

No criminal charges are anticipated in connection with the incident. "Although today’s resolution is entirely civil, I can say that the matter was thoroughly investigated, and today’s resolution serves the cause of justice and sends a strong deterrent message," Patrick Miles Jr., the U.S. Attorney for the Western District of Michigan, said in an e-mail.

The penalties for Enbridge come on top of other spill-related costs, including $4 million in natural resource damages the company agreed to pay last year. The company has already paid $57.8 million to reimburse the government for cleanup costs tied to its Marshall spill, previously said it would pay $75 million to settle claims pursued by the state of Michigan and spent more than $800 million cleaning up the accident.

Kalamazoo River

Enbridge Chief Executive Officer Al Monaco said in a news release that the company has fulfilled its commitment to restore the Kalamazoo River and surrounding areas. "The learnings from our experience have made us a better company, and the way we think about safety has changed," Monaco said.

In a filing with the Securities and Exchange Commission Wednesday, Enbridge Energy Partners LP said the penalties and additional safety spending will not materially affect earnings, because most of the costs associated with the enhancements have already been incorporated into long-term investment and expense planning.

Enbridge’s 30-inch Line 6B runs through Michigan as it ferries oil between Sarnia, Ontario and Griffith, Ind. At the time of the spill, it was carrying diluted bitumen from Canada. According to a U.S. government complaint, the pipeline rupture — blamed on corrosion — triggered alarms in Enbridge’s control room, but the company failed to notice until at least 17 hours later. Flooding pushed the discharged oil into flood plains and ultimately helped propel it more than 35 miles downstream, with some of that heavy crude coating birds, muskrats and turtles.

Enbridge replaced the entire 285-mile length of Line 6B in 2014.

Spill Prevention

Under the settlement, the company is committing to take extra steps to prevent spills along a pair of 20-inch pipelines that cross the Straits of Mackinac and have drawn scrutiny from Michigan officials worried about a potential spill fouling the Great Lakes. Enbridge agreed to ensure the two pipelines crossing the Straits are buried in a trench when crossing through shallow water and are better supported in deeper depths, and will conduct underwater inspections every two years.

The Kalamazoo River reopened for recreational activities after 22 months of cleanup work that Acting EPA Regional Administrator Robert Kaplan described as "arduous." Cleanup efforts were complicated because some of the heavy crude sunk.

Cynthia Giles, the assistant administrator for EPA’s Office of Enforcement and Compliance Assurance, said the agreement "puts in place advanced leak detection and monitoring requirements to make sure a disaster like this one doesn’t happen again."

The settlement agreement is subject to a 30-day public comment period and is still subject to a judge’s approval.

Bloomberg News by Jennifer A. Dlouhy