By Valerie Volcovici

WASHINGTON (Reuters) - Canadian pipeline operator Enbridge Inc <ENB.TO> has agreed to pay $177 million in penalties and improved safety measures in a settlement with the U.S. government tied to one of the largest inland oil spills in U.S. history.

The settlement, announced on Wednesday by Enbridge, the U.S. Justice Department and the Environmental Protection Agency, resolves Clean Water Act violations stemming from the 2010 failure of Enbridge's Line 6B near Marshall, Michigan, which spilled some 20,000 barrels of oil into a branch of the Kalamazoo River.

It also resolves a second spill that same year in Illinois and commits the company to spend at least $110 million to prevent future spills and improve operations on its pipeline system that extends through seven U.S. states in the Great Lakes region.

Under the settlement, Enbridge Energy Partners, a U.S. subsidiary of Calgary-based Enbridge, will pay a $61 million fine related to the Marshall spill, plus a $1 million fine for a September 2010 spill of about 6,400 barrels of oil from a second pipeline in Romeoville, Illinois.

Enbridge said it accepts the fines and measures required under the consent decree. Brad Shamla, Enbridge vice president of U.S. operations, said the settlement "won't have a material impact on us from a financial perspective." The company estimated the total cost for cleanup to date at $1.2 billion.

"We have accepted the penalties and, in fact, already enacted many of the safety measures set out in the consent agreement," Shamla said on a conference call with reporters.

Shamla added that the company has transformed its safety culture in the aftermath of the 2010 spills.

Enbridge last year reached a $75 million settlement with Michigan requiring it to restore wetlands, compensate the state for money spent on the cleanup, and other measures.

Under the new settlement, Enbridge must improve the maintenance and monitoring of its Lakehead pipeline system, and adopt measures to protect the communities and environment along the nearly 2,000 mile (3,200 km) pipeline. The company must also install leak-detection and monitoring systems to prevent future accidents, to be audited by a third party.

The Justice Department said the agreement also resolves Enbridge's liability under the Oil Pollution Act. It will pay more than $5.4 million in unreimbursed cleanup costs for the Marshall spill, as well as all future removal costs.

"This settlement will make the delivery of our nation's energy resources safer and more environmentally responsible," Assistant Attorney General John Cruden of the Justice Department's Environment and Natural Resources Division said.Environmental groups said Enbridge got off lightly in the deal, and called for stronger penalties going forward.

"A $62 million penalty and promises to maintain pipelines as a penalty for the worst inland oil disaster in U.S. history is woefully insufficient," said Collin O'Mara, president of the National Wildlife Federation.

(Reporting by Valerie Volcovici in Washington and Julie Gordon in Vancouver; Additional reporting by David Shepardson in Washington; Editing by Will Dunham)