Wall Street investors were dealt another sharp setback Thursday in their crusade to have the federal courts deliver a windfall on their shares of Fannie Mae and Freddie Mac.

A federal appeals court upheld the dismissal of a case in which investors claimed that the U.S. government illegally seized billions of dollars from the firms.

“Four of our sister circuits—the Fifth, Sixth, Seventh, 3 and D.C. Circuits—have already rejected materially identical arguments from other shareholders,” wrote Judge Jane Louise Kelly of the United States Court of Appeals for the Eighth Circuit. “Today, we join them.”

The government has an unbroken track record of legal victories in a series of cases brought by investors, beginning with the 2014 decision by Judge Royce Lamberth. In each case, the government has won both at the district court level and at the appeals court level.

Last year, the Supreme Court refused to hear the appeal of one of those decisions.

The Treasury is represented by the Justice Department in these lawsuits, while the Federal Housing Finance Agency is represented by the law firm Arnold & Porter. Their legal victories are all the more notable because the shareholders have been represented by some of the most famous litigators in the U.S., including Gibson, Dunn & Crutcher attorney Theodore B. Olson and Cooper & Kirk’s Charles Cooper (who Jeff Sessions retained to be his attorney on Russia related matters). The cases have largely been financed by hedge funds, according to people familiar with the matter.

Investors began filing lawsuits in courts around the country after the government in 2012 amended the terms of its bailout of the two mortgage-financing giants. Under the terms of the amended agreements, both companies pay substantially all of their profits to the U.S. Treasury but owe nothing in quarters that result in losses.

The government’s Federal Housing Finance Agency took over Fannie and Freddie during the 2008 financial crisis. The Treasury agreed to invest vast sums to keep them afloat. The U.S. ultimately provided the companies with nearly $188 billion.

Under the original terms of the bailout, the government received a preferred stock that paid a 10% dividend along with warrants that would allow it to acquire nearly 80% of Fannie and Freddie’s common stock. But Fannie and Freddie struggled to pay the 10 percent dividend and were forced to dip even further into their bailout funds to meet their obligations to Treasury.

To end this so-called “circular draw,” the government revamped the dividend formula into what is known as a “net worth sweep.” Instead of a fixed quarterly dividend, the companies now pay a dividend only when they are profitable. In quarters when the companies lose money, they pay nothing.

The change in the dividends coincided with a return to profitability for the companies. As a result, for several years they paid more in dividends than they would have under the original deal.

More recently, however, interest rate volatility has lowered profits or even triggered losses, resulting in the companies paying less than they would have under the fixed dividend.

The U.S. Court of Appeals for the Eight Circuit on Tuesday affirmed in total the trial judge’s ruling that the 2008 law authorizing the bailout effectively blocked the investors from bringing their claims in federal court.

“Congress, intentionally or otherwise, may have created a monster by handing an agency breathtakingly broad powers and insulating the exercise of those powers from judicial review. Even so, clear statutory text dictates the outcome,” Judge David Stras wrote in his concurring opinion.

Judicial support for the government’s position cuts across ideological lines. Judge Kelly was appointed to the court by Barack Obama. Judge Duane Benton, who joined Kelly’s opinion, was appointed by George Bush. Judge Stras was appointed by President Donald Trump.

Investor hopes for a legal victory are now quite narrow. The D.C. Circuit, which dismissed most investor claims, sent the case down for further proceedings based on a small set of contractual claims.

Another case has been before the U.S. Court of Federal Claims in Washington, D.C. for nearly four years. The judge in that court allowed shareholders to conduct discovery and take depositions but recent filings in that case show that, despite the government handing over tens of thousands of documents, the process turned up little or nothing.

Some investors had entertained hopes early in the Trump administration that the new government officials would reverse the Obama administration’s goal of winding down Fannie and Freddie. But despite some encouraging—albeit ambiguous—statements from Trump administration officials, no significant policy changes have been forthcoming.

This summer the Trump administration put forward a proposal to privatize the two companies and release them from conservatorship. But the plan relies on Congress to pass a housing finance reform bill, something which Congress has tried and failed to do several times since the financial crisis. What’s more, the plan calls for Congress eliminate the federal charters for Fannie Mae and Freddie Mac, a move most investors would resist since much of the value of the companies is created by their ties to the government.