New Jersey may end up spending as much money on legal fees from a controversial settlement with Exxon Mobil as it will dedicate toward environmental programs, documents show.

Roughly $50 million — one fifth of a $225 million settlement between the state and the oil giant over pollution at their facilities in New Jersey — could go toward payment to an outside counsel if the agreement is approved by a judge.

The settlement, which was announced last week, would end more than a decade in litigation over pollution at two refineries in Hudson and Union counties, as well as contamination at other sites. Environmentalists and legislators have criticized the deal because the state had assessed the extent of the damages at $8.9 billion during trial.

At a town hall meeting today, Gov. Chris Christie made his first public comments on the agreement, calling it "a good deal."

"They're going to have to clean up everything no matter what it costs, and we're going to get the $225 million on top of it," Christie said.

CONTINGENCY FEES

State officials have defended the settlement as an historic win for a pollution suit. They also note that the outside firm, Kanner & Associates of New Orleans, took the case on a contingency basis.

In 2004, the state commissioned Allan Kanner, an expert in environmental law, to represent New Jersey as the Exxon case wended its way through the courts.

Kanner referred requests for comment to the Attorney General's office, citing terms of their agreement. Under that agreement, the firm would only be paid if the case was won or settled. The case went to trial, and a judge was expected to rule soon when the state notified him in February that it was reaching an agreement with Exxon.

"Had the state lost the case, outside counsel bore the risk of coming away with nothing after having paid those costs," said Lee Moore, a spokesman for acting Attorney General John Hoffman.

According to the 2004 retention agreement, a copy of which was provided to NJ Advance Media, the firm will be paid on a sliding scale of 20 to 25 percent of the final sum after subtracting "direct costs" such as copies, filing fees and expert reports. The firm spent nearly $1.2 million to commission testimony and reports from environmental experts, according to court documents from 2011.

Moore said direct costs could amount to "approximately" $5 million, though the total would be subject to "a final, detailed accounting" after the settlement was approved by a Superior Court judge.

All told, the law firm could get just over 20 percent of the settlement.

REMEDIATION ONGOING

The Exxon settlement involves the company's liability for so-called "natural resource damages" — essentially paying the public back for the decades of lost use of productive wetlands, which are an important animal habitat, recreational resource and storm buffer.

Separate remediation projects, ordered by the state and paid for by Exxon, have been ongoing at the two sites, known as Bayonne and Bayway, since 1991, according to the Department of Environmental Protection.

The money from the Exxon settlement was not meant to go toward remediation, the governor said during the town hall in Somerville.

"They have to fix everything that they polluted to state standards and there is no cap on what they have to pay," Christie said.

Critics say, however, that the state is missing out on billions in additional damages it's owed by a longtime polluter.

"This lawsuit is not about the clean up," said Sen. Ray Lesniak (D-Union). "It's about restoration and reparation."

SETTLEMENT SCRUTINIZED

The controversy has led to scrutiny of how much money from environmental settlements is used by the state to improve the environment versus how much is used for legal fees or used to balance the budget.

According to figures released by the governor's office, the settlement would be the largest sum New Jersey has recovered from a single entity through a natural resource damages claim, topping the $190 million agreement reached with Occidental Chemical Co. over pollution in the Passaic River last year, though the state recovered an additional $165 million in two other suits involving the Passaic.

In the Passaic River litigation, $67 million of a total $355.4 million was set aside for "natural resource restoration" projects.

Under current budget language, the state would set aside $50 million of the Exxon settlement for similar projects — roughly the same amount it pays its lawyers.

At a senate budget committee hearing Monday, Sen. Paul Sarlo (D-Bergen) introduced legislation that would recoup more of that money for restoration projects, setting aside half of anything over $50 million for the state's Hazardous Discharge Site Cleanup fund.

Previous attempts to enact a similar formula have been vetoed by the governor.

NJ Advance Media reporter Matt Arco contributed to this report.

S.P. Sullivan may be reached at ssullivan@njadvancemedia.com. Follow him on Twitter. Find NJ.com on Facebook.