The agreement resolves a long-running lawsuit against the Kerr-McGee energy and chemical company, which Anadarko bought in 2006. The case was brought by a trust representing the U.S. government, 11 state governments, Indian tribes and individuals.

The trust was seeking cleanup costs at more than 2,000 sites nationwide. It was also seeking payment for claims from more than 8,000 people who said their exposure to Kerr-McGee's wood treatment plants in Avoca, Pennsylvania and Manville, New Jersey caused cancer, which in some cases led to death.

"If you are responsible for 85 years of poisoning the earth, you are responsible for cleaning it up," the U.S. Attorney for Manhattan, Preet Bharara, said at a news conference announcing the settlement.

Despite the size of the settlement, investors cheered, boosting Anadarko's share price 14.5 percent to $99.02 per share. Analysts said the company was facing the possibility of having to pay a much higher price.

"This is a premier exploration company that has this dark cloud hanging over them and now its gone," said Fadel Gheit, oil analyst at Oppenhemier.

Anadarko had argued the environmental liabilities belonged to Tronox Ltd, a paint and chemicals company that was spun off from Kerr-McGee. The sale of Tronox, which ultimately fell into bankruptcy, happened before Anadarko's purchase.

In December, U.S. Bankruptcy Judge Allan Gropper of New York said Kerr-McGee knew the spin-off would harm Tronox's business by weighing it with heavy environmental liabilities. He said Anadarko should pay from $5.15 billion to more than $14 billion in cleanup costs. Anadarko said after the ruling the liabilities should be as little as $850 million.

Tronox, which makes titanium dioxide used in paints, said in a statement that the accord means "the cleanup of the Kerr-McGee legacy environmental damages can begin and people injured by those actions can finally be compensated."

RECORD SETTLEMENT

At one point Kerr-McGee gave Tronox control of a nuclear fuel plant in Oklahoma, where activist worker Karen Silkwood had been employed years earlier. Meryl Streep portrayed her in the eponymous 1983 film about her fight to improve workers' safety before her death in a car accident.

The settlement with Anadarko is the largest environmental enforcement settlement ever by the Department of Justice, larger even than its plea agreement with BP over its massive 2010 Gulf oil spill, which resulted in $4 billion in criminal fines for the British company.

The lawsuits blamed Kerr-McGee's use of coal tar creosote, which the Environmental Protection Agency has said is a probable cause of cancer. Another troublesome operation was Kerr-McGee's decades-old jet and rocket fuel manufacturing plant in Henderson, Nevada, where ammonium perchlorate, a primary fuel component, penetrated soil and then groundwater, causing potential harm to people in Nevada, California and Arizona.

Anadarko said in a statement that it would record a net $550 million tax benefit from the agreement.

"This settlement agreement with the Litigation Trust and the U.S. Government eliminates the uncertainty this dispute has created," Anadarko Chief Executive Officer Al Walker said.

A Department of Justice source who asked not to be identified said "Anadarko was not found to have done anything wrong."

CLEAN-UP

The $5.15 billion settlement will fund a wide array of projects, including $1.1 billion to address the perchlorate contamination in Nevada, the litigation trust said in a statement.

The Navajo Nation will get about $1 billion to address radioactive contamination from Kerr-McGee's decades-old uranium mining operation. Another $1.1 billion will go toward cleanup at more than two dozen contaminated sites around the country.

Tronox used its Chapter 11 bankruptcy protection case to shed the environmental liabilities it had inherited in the spinoff by assigning them to a litigation trust. It emerged from bankruptcy in 2011.

The trust in turn sued Anadarko and Kerr-McGee, arguing the spinoff was a fraudulent ploy by Kerr-McGee to offload its clean-up responsibilities and make itself a more valuable takeover target for Anadarko, and that it doomed Tronox by loading it up with too much liability.

U.S. Attorney Bharara said Kerr-McGee had tried to avoid the cleanup "through a corporate shell game."

(Additional reporting by Julia Edwards, Ayesha Roscoe and David Ingram in Washington, D.C. and Terry Wade and Anna Driver in Houston; Editing by Tom Hals in Wilmington, Delaware and Grant McCool)

By Nick Brown

Stocks treated in this article : Anadarko Petroleum Corporation, Tronox Ltd