The federal government on Thursday reached a $5.15 billion settlement with Anadarko Petroleum Corp., the largest ever for environmental contamination, to settle claims related to the cleanup of thousands of sites tainted with hazardous chemicals for decades.

The bulk of the money — $4.4 billion — will pay for environmental cleanup and be used to settle claims stemming from the legacy contamination.

The settlement resolves a legal battle over Tronox Inc., a spinoff of Kerr-McGee Corp., a company Anadarko acquired in 2006.

The Justice Department said Kerr-McGee, founded in 1929, left behind a long legacy of environmental contamination: polluting Lake Mead in Nevada with rocket fuel, leaving behind radioactive waste piles throughout the territory of the Navajo Nation, and dumping carcinogenic creosote in communities throughout the East, Midwest and South at its wood-treating facilities.

The company, rather than pay for the environmental mess it created, decided to shift the liabilities between 2002 and 2006 into Tronox, the Justuce Department said, while Kerr-McGee kept its valuable oil and gas assets.

"Kerr-McGee's businesses all over this country left significant, lasting environmental damage in their wake," Deputy Attorney General James Cole said. "It tried to shed its responsibility for this environmental damage and stick the United States with the huge cleanup bill."

The settlement releases Anadarko from all claims against Kerr-McGee.

"This settlement ... eliminates the uncertainty this dispute has created, and the proceeds will fund the remediation and cleanup of the legacy environmental liabilities," said Anadarko CEO Al Walker.

The settlement funds will be paid into a trust that covers cleanup of contaminated sites across 22 states and the Navajo Nation.

Among the sites targeted for cleanup under the settlement are a former chemical manufacturing site in Nevada that has led to contamination of Lake Mead and a Superfund property in Gloucester, N.J., contaminated with thorium. About $1 billion will be directed to the Navajo Nation to address radioactive waste left behind by the region's abandoned uranium mines.

The U.S. initially sought $25 billion to clean up decades of contamination at dozens of sites. A U.S. bankruptcy judge in New York in December found Kerr-McGee had improperly shifted its environmental liabilities to Tronox and should pay between $5.15 billion and $14.2 billion, plus attorney's fees. Cole said at a news conference Thursday that the government decided that the $5.15 billion amount was more than enough to cover the damages.

"It provides us with recovery now as opposed to years and years down the road," he said.

Tronox said in a statement that the settlement means environmental cleanup can begin and that people harmed by the pollution can be compensated.

The Associated Press