Two groups of American International Group Inc. shareholders won class-action status from a federal judge on Monday in a $25 billion lawsuit by former Chief Executive Maurice “Hank” Greenberg over alleged losses caused by the U.S. government’s bailout of the insurer.

U.S. Court of Federal Claims Judge Thomas Wheeler also appointed Greenberg’s lawyer, David Boies, of Boies, Schiller & Flexner LLP, as lead counsel for the classes.

Greenberg’s Starr International Co, once AIG’s largest shareholder with a 12 percent stake, sued the United States in 2011 over what eventually became a $182.3 billion bailout for the New York-based insurer.

It said that by taking a 79.9 percent AIG stake and then conducting a reverse stock split without letting existing shareholders vote, the government conducted an illegal taking that violated the 5th Amendment of the U.S. Constitution.

Citing Boies’ estimate that “tens of thousands” of shareholders might be affected, Wheeler said “class certification is by far the most efficient method of adjudicating these claims.”

He distinguished the case from the U.S. Supreme Court’s 2011 rejection of class status for more than 1 million Wal-Mart Stores Inc. workers alleging gender bias, saying the AIG claims are “based on the same exact government action” rather than “literally millions” of separate actions.

One class includes AIG shareholders as of Sept. 22, 2008, when a credit agreement awarding the 79.9 percent stake took effect.

The other class includes shareholders as of June 30, 2009 who were denied a chance to vote on the reverse split.

U.S. Department of Justice spokesman Charles Miller declined to comment.

AIG decided on Jan. 9 not to join Greenberg’s lawsuit, amid anger from Congress and voters at the prospect that it might sue the same entity that rescued it from collapse.

Greenberg is separately appealing the Nov. 19, 2012 dismissal of a related lawsuit in Manhattan federal court against the Federal Reserve Bank of New York.

On March 1, AIG bought back warrants from the Treasury Department, eliminating the government’s last financial interest in the insurer.

The case is Starr International Co. v. U.S., U.S. Court of Federal Claims, No. 11-00779.