A federal appeals court has rejected a shareholder appeal in a lawsuit challenging the U.S. government’s ability to seize all of the quarterly profits generated by Fannie Mae and Freddie Mac after the companies’ bailout amid the 2008 financial crisis.

In a precedential opinion, a three-judge panel of the U.S. Court of Appeals for the Third Circuit ruled Wednesday that the federal agency created to oversee the government-sponsored firms was acting within its power in 2012, when it changed the bailout terms, for the third time, to force the Fannie and Freddie to pay the U.S. Department of the Treasury quarterly dividends equal to their net worth.