WASHINGTON — The Justice Department and five states on Monday announced a $20 billion final settlement of environmental damage claims arising from the 2010 Deepwater Horizon oil spill in the Gulf of Mexico.

The deal, once approved by a judge, would resolve all civil claims against BP and end five years of legal fighting over a 134 million-gallon spill that affected 1,300 miles of shoreline. It also would bind the company to a massive cleanup project in the Gulf Coast area aimed at restoring wildlife, habitat and water quality.

"BP is receiving the punishment it deserves, while also providing critical compensation for the injuries that it caused to the environment and the economy of the Gulf region," Attorney General Loretta Lynch said at a Justice Department news conference.

"The steep penalty should inspire BP and its peers to take every measure necessary to ensure that nothing like this can ever happen again," Lynch said.

The settlement, filed in federal court in New Orleans, finalizes an agreement first announced in July. The next steps are a 60-day public comment period and court approval.

In a statement, BP spokesman Geoff Morrell said the settlement total announced Monday includes amounts previously spent or disclosed by the company, and "resolves the largest litigation liabilities remaining from the tragic accident."

Among other requirements, BP would have to pay $5.5 billion in Clean Water Act penalties and nearly $5 billion to five Gulf states: Alabama, Florida, Louisiana, Mississippi and Texas. The company would also be required to pay $8.1 billion in natural resource damages, with funds going toward Gulf restoration projects such as support for coastal wetlands, fish and birds.

An additional $600 million would cover other costs, such as reimbursement for federal and state natural resource damage assessment costs. And up to $1 billion would go to local governments to settle claims for economic damage from the spill, which followed the April 2010 explosion on an offshore oil rig that killed 11 workers.

A coalition of conservation organizations, including the National Audubon Society and the Environmental Defense Fund, praised the arrangement. The groups said in a joint statement that while the full damage of the oil spill may not yet be known, the process "will help bring the Gulf back to the state it was before the spill, and the release of this plan is a positive step toward that end."

But Miyoko Sakashita, oceans director at the Center for Biological Diversity, said the oil spill had damaged the Gulf region in a way that money could never fix. She said the real solution would be to curb offshore oil and gas drilling.

"All of this drilling is really just deepening our climate crisis," she said.

A report by Deepwater Horizon Natural Resource Trustees — comprised of representatives from multiple federal agencies and the Gulf states — called the oil spill damages "unprecedented" and found that deep ocean water currents carried oil from the spill hundreds of miles from the blown-out well. Oil from the spill was deposited onto at least 400 square miles of the sea floor and washed up onto more than 1,300 miles of shoreline from Texas to Florida. The oil was toxic to fish, birds, plankton, turtles and mammals, causing death and disease and making it difficult for animals to reproduce.

Gina McCarthy, the administrator of the Environmental Protection Agency, said that besides the toll on human life, "the spill drove Gulf communities into a period of painful uncertainty, forcing questions that no American family should ever have to ask: Is my food safe to eat? Is it dangerous for my kids to play near the shore? Is the air still clean to breathe? And will my businesses ever recover?"

The latest agreement follows a 2012 settlement between BP and people and businesses harmed by the spill. That settlement so far has resulted in $5.84 billion in payouts, according to a report filed recently in New Orleans.

While the latest settlement will mean the end of a major legal battle, other litigation remains.

For instance, some opted out of the 2012 settlement, and an appellate court battle continues over some of the awards made under that settlement. Some businesses are pursuing claims against BP over financial losses caused by a federal drilling moratorium following the spill. Also, suits by stockholders who say they were harmed by the company's actions remain.

____

Associated Press writers Rebecca Santana, Kevin McGill and Janet McConnaughey in New Orleans contributed to this report.