Anadarko Petroleum Corp.’s (NYSE: APC) agreement April 3 to pay $5.15 billion to settle an environmental suit might have played as a Pyrrhic victory, had the company not been staring at a possible $14.2 billion judgment.

Instead, Anadarko’s stock immediately jumped more than $12 per share April 3 following what the U.S. Department of Justice (DOJ) called the largest recovery for a contamination cleanup in history. At one point the stock went from $86 to $101 that day.

Analysts raised their target prices for the company after cutting expectations by as much as 20%.

The case stems from the merger, about seven years ago, of Anadarko and Kerr-McGee Corp. On Dec. 12, 2013, a U.S. bankruptcy judge issued an opinion saying that Anadarko should be held liable for environmental and health claims related to Kerr-McGee’s spinoff Tronox Inc. Initially, the government and environmental plaintiffs sought $25 billion.

While Anadarko’s settlement removes the “Tronox overhang,” as analysts called it, the case also serves as a cautionary tale about mergers and acquisitions. Anadarko knew, years before it bought Kerr-McGee, about widespread environmental problems associated with the company.

The settlement covers cleanup and payments for various polluted areas in the United States.

What The Anadarko Settlement Cleans Up/Pays For

$1.1 billion

Two dozen contaminated sites around the country.

$1.1 billion

Former chemical manufacturing site in Nevada that has led to contamination in Lake Mead, a source of drinking water.

$985 million

50 abandoned uranium mines in and around the Navajo Nation, where radioactive waste remains from Kerr-McGee mining operations.

$224 million

Thorium contamination at the Welsbach Superfund Site in Gloucester, N.J.

$217 million

Repayment of costs for clean-up of the Federal Creosote Superfund Site in Manville, N.J.

Additional amounts

Federal government, states, Navajo Nation, environmental trusts.

Anadarko acquired the Kerr-McGee exploration and production (E&P) business in 2006, only a few months after Kerr-McGee divested its legacy liabilities, such as polluted Navajo uranium mines.

Four years earlier, Anadarko had considered acquiring Kerr-McGee but walked away. After performing due diligence on Kerr-McGee’s environmental liabilities, Anadarko found Kerr-McGee had more than 500 active pollution sites and had owned more than 1,000 such sites, according to an opinion written by bankruptcy judge Allan L. Gropper.

Anadarko determined that the annual cost of remediation “eats up most of [Kerr-McGee’s] free cash flow,” Gropper said the evidence showed. Furthermore, Kerr-McGee’s future environmental liability was in the “billions” and Anadarko decided there was “no end in sight for at least 30 more years.”

To make itself more attractive to buyers, Kerr-McGee fraudulently conveyed assets to a new company to avoid the liabilities connected to environmental cleanup sites across the country, the DOJ said. That new company, Tronox, was spun off as a separate entity in 2006, according to the DOJ.

Anadarko subsequently re-entered talks with Kerr-McGee and paid $16.4 billion for its assets, which are worth billions more today, Gropper said.

Kerr-McGee’s transactions to Tronox hobbled the company, which specializes in titanium dioxide pigment. Tronox fell into insolvency and was unable to pay its liabilities, including environmental claims. In 2009, Tronox filed for bankruptcy protection.

In December, Gropper said that Anadarko and Kerr-McGee acted with intent to hinder and delay Tronox creditors at the companies and left Tronox insolvent and undercapitalized when it was severed from Kerr-McGee's oil and gas business prior to the merger.

Anadarko chairman, president and CEO Al Walker said the settlement agreement eliminates the uncertainty of the dispute and that the proceeds will fund the remediation and cleanup of the legacy environmental liabilities and tort claims.

“Investor focus can now return to the tremendous value embedded in Anadarko's asset base, allowing our peer-leading operational and exploration results to again become the basis for valuation,” Walker said.

Prior to the settlement, Anadarko had fallen nearly 15% since mid-October, including 7% attributable to the Tronox opinion, said Bob Brackett, senior analyst for Bernstein Research.

“We continue to like Anadarko,” Brackett said, adding that his target price is now $111.

Barclay’s Thomas R. Driscoll said that Anadarko’s new price target increased by $12 to $109.

“We attribute $9 of the $12 increase to the Tronox settlement being below the $9.5 billion that we had reflected in our model, and $3 to fine-tuning our forward estimates,” Driscoll said.