US President Donald Trump has again been thwarted in his attempt to use military money to fund his wall along the border with Mexico.
On Saturday, he lodged an appeal against a ruling by a judge blocking him from using defence department funds for anti-drug activities.
But a panel of the US 9th Circuit Court of Appeals upheld the freeze, saying it was up to Congress to allocate funds.
Mr Trump declared a national emergency over the wall earlier this year.
He said he needed $6.7bn (£5.3bn) to it as a matter of national security.
Building the wall was a major election campaign promise.
Two of the three-judge panel in San Francisco agreed with the lower court's decision.
"As for the public interest, we conclude that it is best served by respecting the Constitution's assignment of the power of the purse to Congress, and by deferring to Congress's understanding of the public interest as reflected in its repeated denial of more funding for border barrier construction," the two judges wrote in their ruling.
In May, federal judge Haywood Gilliam temporarily blocked the use of defence department funds because it had not been approved by Congress.
About 20 states, along with groups including the American Civil Liberties Union (ACLU), have filed lawsuits to try to stop the president using the emergency declaration to bypass Congress.