The ruling was a partial victory for former AIG Chief Executive Maurice Greenberg, who had sued the government over its dramatic rescue of the failing company in September 2008 on the same weekend that investment bank Lehman Brothers went bust.

But Wheeler did not grant Greenberg nor any other shareholders compensation, saying that Greenberg's company Starr International - a major holder of AIG stock at the time of the bailout - would have ended up with nothing had the US Federal Reserve's New York branch not stepped in and lent AIG money.

"While the taking of 79.9 percent equity ownership and the running of AIG's business were not permitted under the Federal Reserve Act, the government did not cause any economic loss to AIG's shareholders," Wheeler wrote in his decision.

"In the end, the Achilles' heel of Starr's case is that, if not for the government intervention, AIG would have filed for bankruptcy," he added.

The verdict, although it did not entirely absolve federal regulators, allowed them some freedom to forge similar plans in future crises.

AIG was teetering on the brink of bankruptcy when the government intervened in 2008 with an initial loan of $85 billion (75.3 billion euros today). The insurance giant's books were overburdened with massive losses it had acquired after selling dubious insurance plans during the subprime mortgage boom.

Those initial rescue funds were conditional on repayment with 14 percent interest and an 80 percent public stake in the company. The amount ultimately rose to $182.3 billion and AIG has since repaid the loans in full, leaving US taxpayers with nearly $23 billion in profit.

Shares in AIG jumped $1.24, or about 2 percent, to $63.13 after the ruling became public. There were fears that shares would have fallen had the judge ruled in favor of Greenberg's claim for $40 billion in damages.

Greenberg left AIG in 2005 and was not at the helm during the bailout. His company, Starr International, had a 12 percent stake in the insurer at the time.

cjc/uhe (Reuters, AFP)