The Trump administration’s bid to immediately reinstate its policy of denying asylum to those who enter the U.S. illegally was denied Friday by the 9th U.S. Circuit Court of Appeals.

The San Francisco-based court stated in a 2-1 ruling that the policy was likely “inconsistent” with existing law.

It marked the latest setback for the Trump administration in a court that President Trump blasted last month as “a disgrace” because of a series of rulings against his policies.

“Because you cannot win, if you're us, a case in the Ninth Circuit," Trump told reporters outside the White House on Nov. 20. “Every case gets filed in the Ninth Circuit ... we get beaten, and then we end up having to go to the Supreme Court.”

TRUMP CONDEMNS 'DISGRACEFUL' 9TH CIRCUIT, DUBBING IT RUBBER-STAMP FOR HIS FOES

In Friday’s ruling, the 9th Circuit described the Trump administration’s attempt to restore the asylum policy as an effort to bypass Congress.

“Just as we may not, as we are often reminded, ‘legislate from the bench,’ neither may the Executive legislate from the Oval Office," 9th Circuit Judge Jay Bybee wrote in the majority opinion. Bybee was nominated to his seat by former President George W. Bush.

“Just as we may not, as we are often reminded, ‘legislate from the bench,’ neither may the Executive legislate from the Oval Office." — Judge Jay Bybee, 9th U.S. Circuit Court of Appeals

At issue was Trump’s Nov. 9 move to bar anyone who crossed the U.S.-Mexico border between official ports of entry from seeking asylum. Trump issued the proclamation as migrant caravans traveled closer to the U.S. through Mexico.

But a lower court judge temporarily blocked the ban and later refused to reinstate it. The administration appealed to the 9th Circuit for a stay of Judge Jon Tigar's Nov. 19 order.

TRUMP POISED FOR MAJOR MAKEOVER OF LIBERAL 9TH CIRCUIT COURT

In a dissenting opinion Friday, 9th Circuit Judge Edward Leavy, who was nominated by President Ronald Reagan, said the administration "adopted legal methods to cope with the current problems rampant at the southern border.”

In his Nov, 19 ruling, Tigar sided with legal groups who argued that federal law is clear that immigrants in the U.S. can request asylum regardless of whether they entered legally.

The ruling led to a public dispute between Trump and Supreme Court Chief Justice John Roberts after Trump dismissed Tigar as an "Obama judge."

Roberts responded that the federal judiciary doesn't have "Obama judges or Trump judges, Bush judges or Clinton judges."

Fox News’ Gregg Re and the Associated Press contributed to this report.