NEW YORK (TheStreet) --Former AIG (AIG) Chief Executive Hank Greenberg has won a landmark lawsuit against the U.S government, but he and his shareholders will not be offered any compensation.

Greenberg claimed that the government overstepped its authority by demanding AIG stock during the company's 2008 bailout. Federal Judge Thomas Wheeler concluded that "The government's unduly harsh treatment of AIG in comparison to other institutions seemingly was misguided and had no legitimate purpose."

But though the government may have over stepped its authority by demanding equity in AIG in return for aid, Wheeler said, shareholders were not legally entitled to any financial compensation as a result of that behavior. If the government hadn't intervened, he noted, AIG would have been left bankrupt and shareholders would have lost everything.

During the financial crisis the U.S. government provided the insurance giant with an $85 billion bailout loan in return for a 79.9% equity stake in the company and repayment at a 14.5% interest rate. The court decreed that the government's actions violated Section 13(3) of the Federal Reserve Act. The government countered with the claim that because the loan was high risk, its demands were reasonable. Following the bailout, AIG swung back into profitability, paying back the loan by 2012 and leaving the government with around $22.7 billion in profit from the AIG deal terms.

Despite many people dismissing Greenberg's case as farcical, the former CEO pushed ahead, demanding around $25 billion in compensation for shareholders.

The eight-week trial included testimony from financial heavyweights including Ben Bernanke and Hank Paulson. The outcome of the trial may affect how the government uses emergency powers during future bailouts or financial crises.

More from Investing

Trump's Oil Tweets Ruining the Stock Market's Rebound?

Trump's Oil Tweets Ruining the Stock Market's Rebound?

A BJ's Wholesale IPO Is Logical Next Step

A BJ's Wholesale IPO Is Logical Next Step

Tesla Investor Pushing for More Board Changes

Tesla Investor Pushing for More Board Changes

What You Need to Know About Facebook and Europe's New Privacy Rules

What You Need to Know About Facebook and Europe's New Privacy Rules

8 Bold Moves General Motors Could Make to Rev Up Its Battered Stock Price

8 Bold Moves General Motors Could Make to Rev Up Its Battered Stock Price