Still, the judge did not award any monetary damages to Mr. Greenberg, making it a moral victory, but not an economic one. Mr. Greenberg had sought $40 billion and has spent millions bringing his case.

Judge Wheeler determined that Mr. Greenberg and the other shareholders did not suffer any economic damage because “if the government had done nothing, the shareholders would have been left with 100 percent of nothing.” The judge cited John Studzinski, vice chairman of the Blackstone Group and an adviser to A.I.G., who had instructed the board to accept the government’s offer in 2008, telling the room of directors: “Twenty percent of something [is] better than 100 percent of nothing.”

Inexplicably, that line of logic did not extend to the judge’s ruling that the government had unfairly taken advantage of A.I.G. by requiring tough loan terms, including the equity stake and a 12 percent interest rate.

“No matter how rationally A.I.G.’s board addressed its alternatives that night, and notwithstanding that A.I.G. had a team of outstanding professional advisers, the fact remains that A.I.G. was at the government’s mercy,” the judge wrote.

Judge Paul A. Engelmayer of Federal District Court in Manhattan, who threw out the earlier companion case, had said that the claim that A.I.G.’s board was under the control of the government was specious. By the logic of Mr. Greenberg’s case, the judge had written, “a loan shark whose usurious interest rate is agreed to by a small business so that it may stay afloat could equally be said to have had actual control over that business so as to compel its agreement to a loan.”

Dennis Kelleher, president and chief executive of Better Markets, an advocacy group for financial reform, called Judge Wheeler’s ruling perplexing.

“The court bizarrely expressed repeated sympathy for A.I.G. while failing to properly weigh the economic wreckage suffered by the American people,” Mr. Kelleher said in an email. “It’s the U.S. taxpayers that have been victimized here by A.I.G. when it acted recklessly, precipitated the crash of the financial system, took a $185 billion bailout, and then gave bonuses to some of the very same people who irresponsibly sold the derivatives that blew up the company.”