Chevron and Patton Boggs have settled disputes linked to long-running litigation over toxic drilling waste pits in Ecuador by Patton Boggs agreeing to pay Chevron $15 million, issue a statement of regret and withdraw from the Ecuador case. Chevron agreed to release all claims against Patton Boggs and its partners.

The settlement is a stunning and highly unusual setback for any law firm, let alone the nation’s leading lobbying firm, long a bedrock of the Washington establishment. While the payment will cover only a tiny portion of the money Chevron has spent on the legal battle, the settlement overall tarnishes the reputation of Patton Boggs.

Yet the settlement, which a senior official at the firm said would be entirely covered by Patton Boggs’s insurance policy, also removes a threat to the health of the firm. Patton Boggs had already been struggling with financial pressures common to the legal industry and has recently been exploring possible mergers in a bid to restore its stability.

The case for Patton Boggs initially seemed straightforward enough. Chevron was facing a $9.5 billion judgment handed down by an Ecuadoran court for health and environmental damages caused by hundreds of leaky pits filled with thick toxic waste from oil drilling. In 2010, Patton Boggs began representing indigenous people from Ecuador’s Amazon who were seeking to collect those damages. The firm became one of the architects of a strategy to collect on the judgment in the United States and a variety of other countries, including Argentina, Canada and Brazil.

But instead of seeing much of that money for itself or its plaintiffs, Patton Boggs got sucked into a brutal fight with one of the country’s most powerful companies.

Now, as part of the settlement with Chevron, Patton Boggs has agreed to assign its 5 percent interest in any money the plaintiffs might obtain. It also agreed to assist Chevron with discovery against the Ecuadoran plaintiffs and their New York-based lawyer, Steven Donziger, who has been doggedly fighting Chevron for more than two decades and who Chevron has argued was part of a racketeering scheme to obtain a fraudulent judgment.

That discovery would cover details about current efforts to enforce the Ecuadoran court judgment overseas. Sources familiar with the case said it could lead to disclosures about offshore entities, one called Amazonia and another called New Co., set up to collect money from enforcements abroad.

“We are pleased that Patton Boggs is ending its association with the fraudulent and extortionate Ecuador litigation scheme,” said R. Hewitt Pate, Chevron’s vice president and general counsel, in a statement. “Chevron detailed its objections to Patton Boggs’ conduct in its counterclaim, and today’s agreement brings that litigation to an end. Chevron encourages others to disassociate themselves from this fraud.”

Patton Boggs said in a statement Wednesday that the settlement ends the firm’s involvement in the Ecuador case. The firm noted that a recent court ruling sided with Chevron’s claims of fraud and racketeering against Donziger, whom Patton Boggs was helping enforce the Ecuadoran judgment. “Based on the Court’s findings, Patton Boggs regrets its involvement in this matter,” the statement said.

Donziger and the Ecuadoran plaintiffs issued a joint statement condemning “this sad and unethical betrayal” by Patton Boggs and Chevron’s “continuing campaign of extortion and intimidation.” They vowed to continue to press the case in appeals courts and challenge the settlement, which they said was a violation of attorney-client privilege.

The case has taken a toll on Patton Boggs, contributed to the departure of some of its partners and complicated negotiations about a possible merger with other firms. It has recently been close to a deal with Squire Sanders, although Dentons has also expressed interest in acquiring the firm.

A spokesman for Squire Sanders said Wednesday that merger talks were ongoing.

“It’s an unusual situation. I suspect they had to do that settlement to get their merger through,” said the managing partner of another big Washington law and lobbying firm, who spoke on background so he could talk freely about the competition.

“There’s no way anybody is going to merge with that firm with that liability hanging over it,” he added. “They’re more interested in the firm’s survival than they are in the hit that this is going to be to them from a publicity standpoint.”

In an interview in late March, Dentons Global Chair Joseph Andrew said that Patton Boggs still had “a fantastic brand” and that it had offered to hold talks about merging. But other lawyers cautioned that the apology and cooperation pledges in the Chevron settlement could do damage to the firm’s brand.

Despite its troubles, Patton Boggs remained the top lobbying firm by revenue last year, collecting nearly $40 million in reported lobbying fees. In the first quarter of this year, it reported $9.3 million in lobbying revenue, a 9 percent decline from the previous year.

Chevron has also said it waged a legal fight against the judgment instead of settling as a warning to others who might file lawsuits against big companies in the hope of getting a substantial settlement. Patton Boggs had agreed to represent the Ecuadoran plaintiffs and Donziger in return for getting a share of any enforcements or of a settlement, which the firm anticipated might amount to hundreds of millions of dollars, according to earlier court filings.

Patton Boggs’s compliance with the Chevron settlement will be overseen by a special master under the jurisdiction of New York District Court Judge Lewis Kaplan, whom Patton Boggs repeatedly tried to get removed from the case; Kaplan ruled in favor of Chevron’s claims of fraud and racketeering against Donziger and the plaintiffs.

The case, which has dragged on for two decades, grew out of a dispute over toxic drilling waste pits left behind in Ecuador’s Amazon by Texaco, which left the South American country in 1992. Nine years later, Chevron acquired Texaco. Chevron argued that Texaco had fulfilled its obligations to clean up a portion of those pits years ago under an agreement with the government of Ecuador and its partner, the Ecuadoran state-owned oil company.

Holly Yeager contributed to this article