(AP Photo/Manuel Balce Ceneta, File)

Fannie Mae and Freddie Mac shares plunged Tuesday after a federal appeals court denied legal claims by investors who were seeking to stop the U.S. government from seizing the profits of the mortgage giants.

Fannie shares sank 35 percent to $2.71. Freddie shares tumbled 38 percent to $2.47.

Hopes for reform of the government-sponsored enterprises had lifted shares of Fannie and Freddie following President Trump’s election. Shares of Fannie went from a low of $1.26 to a high of $5.00, only to retreat after Tuesday’s ruling.

In a 2-to-1 decision, the U.S. Court of Appeals for the District of Columbia affirmed an earlier ruling by U.S. District Judge Royce Lamberth.

“We hold that the stockholders’ statutory claims are barred by the Recovery Act’s [the 2009 American Recovery and Reinvestment Act] strict limitation on judicial review,” Senior Circuit Judge Douglas H. Ginsburg and Circuit Judge Patricia Millett wrote in the majority opinion. “We also reject most of the stockholders’ common-law claims.”

The decision was a setback for hedge funds and other investors who were challenging the Third Amendment, a decision by the federal government to confiscate the GSE’s profits.

“The Perry decision is undeniably a body blow for GSE shareholders, but this ruling does not constitute a knockout, as there are still both legal and administrative avenues for shareholders,” said Isaac Boltansky, an analyst at Compass Point, an investment bank, in a research report on Tuesday.

Fannie and Freddie went into conservatorship during the 2008 financial crisis, receiving a nearly $188 billion bailout from the federal government. In return, Fannie and Freddie were required to pay a 10 percent dividend to the government. In 2012, the terms of the bailout were amended — the Third Amendment — forcing Fannie and Freddie to forward all their profits to the U.S. Treasury.

On Friday, Fannie and Freddie announced they were sending a combined $10 million in dividends to the U.S. Treasury. Fannie reported a $5 billion profit for the fourth quarter, while Freddie reported a $4.8 billion fourth-quarter profit. Fannie will pay a $5.5 billion dividend, and Freddie will pay a $4.5 billion dividend. The U.S. Treasury has collected nearly $250 billion from the GSEs.

Because the GSE’s profits have been going to the government, there was nothing left for the investors, who cried foul.

The court didn’t completely rule against the investors. They can still pursue breach of contract claims and may yet receive monetary damages.

“The damages that we could recover could be very substantial, though undoubtedly the amount will be hotly disputed,” said Hamish Hume, a partner at Boies Schiller Flexner who represented shareholders in this case.

Shareholders may still appeal parts of the decision, but it is too early to decide, he said.

“I do think that the existence of the new administration gives us some cautious optimism or hope that members of the new administration may take a fresh look at this issue,” said Hume. “We hope that they may take a look at it and see the injustice.”

This post has been updated. Renae Merle contributed to this report.