The state retained the Kanner firm more than a decade ago to help develop an initiative that would include suing for compensation for damages to natural resources and the loss of their use to the public. A 2004 news release from the attorney general’s office that announced the first wave of cases said the state would be assisted by “a group of experienced outside counsel.”

Jeffrey Jacobson, a top adviser to Mr. Hoffman, said in an interview last April with Law360, “In these big-stakes cases like the $9 billion Exxon trial, New Jersey should and will be happy that we had those outside partners working with us.”

During the damages trial, John Sacco, an official with the Department of Environment Protection, testified about the rationale for using outside firms. The environmental agency, as well as the attorney general’s office, he said, did not “have the expertise in-house to litigate a case of this complexity.”

Exxon, meanwhile, was represented by a legal team led by Theodore V. Wells Jr., a partner and co-chairman of the litigation department at Paul, Weiss, Rifkind, Wharton & Garrison, a prominent Manhattan law firm.

The Kanner firm, which declined to comment for this article, helped the state assess potential lawsuits under the initiative and try cases that could not be settled, according to a biography of the firm filed in court. The firm was also assigned to handle the Exxon suits, which sought damages for contamination by refineries in Bayonne and Linden, also known as Bayway.

The firm was to be paid on a contingency basis, with a sliding scale that included a fee of 20 percent of recoveries over $25 million after a trial begins, according to the retainer agreement, signed by the attorney general at the time, Peter C. Harvey, and the lawyer Allan Kanner.

A judge later invalidated that fee scale, saying the rates had to comply with New Jersey’s court rules, which do not specify a percentage for recoveries over $3 million except to say the fees must be “reasonable.” The fees also had to be approved by a judge.