Perry Capital is appealing the decision by retiring U.S. District Judge Royce Lamberth to dismiss one of the lawsuits brought against the Department of Treasury by Perry Capital and Fairholme Funds.

Currently, Fannie Mae and Freddie Mac profits go to the government, and the investors were suing for their perceived share.

Perry Capital, among others, is suing over the Treasury’s policy of confiscating the profits from the GSEs. At issue is the government's decision to sweep the profits of the companies into the U.S. Treasury was illegal.

Lamberth, notably the second most overturned in his district, said the government had the authority under a 2008 law that laid the ground for its seizure of the two companies.

"The district court's decision overlooks important points of law and improperly resolved key questions of fact based on the government's cherry-picked record," said Theodore Olson, an attorney with Gibson, Dunn & Crutcher LLP, who filed the appeal on behalf of Perry Capital.

The government seized Fannie Mae and Freddie Mac at the height of the financial crisis as they teetered on the brink of insolvency. It took a majority stake in each.

The Treasury ended up pumping $187.5 billion into the companies. They have since returned to profitability and have returned $218.7 billion to taxpayers in the form of dividends.

Initially, the companies were required to pay a 10 percent dividend on the government's share, but later the Treasury and their regulator altered the terms to force them to hand over nearly all their profits.

The dismissal of the lawsuit dealt a blow to investors hoping to benefit now that Fannie Mae and Freddie Mac, the two largest sources of U.S. housing finance, are profitable. However, other lawsuits challenging the bailout terms are still pending.