Federal officials acted improperly when they seized AIG shares in 2008 as part of the insurer's bailout, a federal judge ruled Monday.
But shareholders are not entitled to any monetary damages.
The ruling concluded a lawsuit brought by former AIG boss Hank Greenberg, who was one of AIG's largest shareholders and claimed the government effectively ripped him off when it took control of the insurer.
Judge Thomas Wheeler wrote that the government's harsh treatment of AIG "was misguided and had no legitimate purpose."
He came down hard on the government for its actions during the meltdown, including taking control of AIG, appointing executives and forcing the company to sell off assets.
Related: U.S. ends TARP with $15.3 billion profit
As a result, AIG shareholders were virtually wiped out. Major banks including Bank of America (BAC) and Citigroup (C) were also bailed out during the financial meltdown, but the terms of those deals were far less onerous for shareholders.
Taxpayers eventually made an estimated $22.7 billion profit on the $152 billion AIG bailout. But Greenberg, who had sought $25 billion in damages as part of his case, was not awarded any damages under Wheeler's ruling. The judge said that AIG shareholders would have been wiped out even without the bailout.
"In the end, the Achilles' heel of [the] case is that, if not for the government's intervention, AIG would have filed for bankruptcy. In a bankruptcy proceeding, AIG's shareholders would most likely have lost 100 percent of their stock value," wrote Wheeler.
The Treasury Department agreed, although maintained its legal authority in taking over the insurer.
"At the height of the financial crisis, the U.S. government took decisive action to rescue AIG and to protect American taxpayers," it said in a statement. "The Court confirmed today that AIG shareholders were not harmed by those actions. [But we] continue to believe that the government acted well within legal bounds."
Several high-profile officials, including former Treasury secretaries Hank Paulson and Timothy Geithner and former Fed Chairman Ben Bernanke were all forced to testify on the case in open court.
A spokesman for David Boies, Greenberg's attorney, was not immediately available for comment.