(CN) – A federal judge in Delaware dismissed a shareholder action challenging the Federal Housing Finance Agency’s authority to divert Fannie Mae and Freddie Mac’s future profits to the U.S. Treasury as a condition of the mortgage giants’ $188 billion bailout during the 2008 financial crisis.

Numerous lawsuits have been filed by Fannie Mae and Freddie Mac shareholders in jurisdictions all across the country challenging the 2008 bailout conditions placed on the companies.

According to the government, the 2008 collapse of the housing market left the Federal National Mortgage Association, also called Fannie Mae, and the Federal Home Loan Mortgage Corp., or Freddie Mac, in danger of folding.

To avoid the economic disaster that such a collapse would create, Congress enacted the Housing and Economic Recovery Act, or HERA, authorizing the Treasury to purchase any obligations or securities issued by either company.

The Federal Housing Finance Agency, abbreviated as FHFA, placed Fannie and Freddie under conservatorship in September 2008, and committed $100 billion in funding to each corporation.

A second amendment to the bailout agreement raised the limit to $200 billion each, in exchange for a dividend worth 10 percent of the Treasury’s existing liquidation preference.

In a third amendment, the Treasury replaced the previous dividend formula and simply required that Fannie and Freddie pay the Treasury the amount by which their net worth exceeded a fixed capital buffer, a figure that shrank each quarter.

This final amendment, according to Fannie and Freddie shareholders, effectively nationalized the mortgage lenders by diverting every penny of profits to the Treasury.

Even though both Fannie and Freddie are now hugely profitable, all profits – $186 billion since 2012 – continue to go to the government rather than shareholders.

An action challenging FHFA’s bailout terms was rejected by a 2-1 decision of the D.C. Circuit in February. Other related cases are pending before the Fifth, Sixth, Seventh and Eighth Circuits.

A federal judge in the District of Delaware, which appeals to the Third Circuit, rejected yet another shareholder action, finding that the Housing Authority acted within its authority by demanding the mortgage giants’ profits as a condition of the bailout.

“The Third Amendment falls squarely within the powers granted to the Agency under HERA, because renegotiating dividend agreements, managing debt obligations, and ensuring ongoing access to capital are some of the quintessential tasks of reorganizing, operating, and preserving a business,” U.S. District Judge Gregory Sleet said.

Further, the judge rejected the shareholder’s assertions that HERA violates state law and noted that his power to review the agency’s decision was quite narrow.