WASHINGTON — The Supreme Court on Friday gave President Trump a victory in his fight for a wall along the Mexican border by allowing the administration to begin using $2.5 billion in Pentagon money for the construction.
In a 5-to-4 ruling, the court overturned an appellate decision and said that the administration could tap the money while litigation over the matter proceeds. But that will most likely take many months or longer, allowing Mr. Trump to move ahead before the case returns to the Supreme Court after further proceedings in the appeals court.
While the order was only one paragraph long and unsigned, the Supreme Court said the groups challenging the administration did not appear to have a legal right to do so. That was an indication that the court’s conservative majority was likely to side with the administration in the end.
The court’s four more liberal justices dissented. One of them, Stephen G. Breyer, wrote that he would have allowed the administration to pursue preparatory work but not construction, which he said would be hard to undo if the administration ultimately lost the case.
President Trump promptly posted on Twitter that he was delighted with the ruling: “Wow! Big VICTORY on the Wall. The United States Supreme Court overturns lower court injunction, allows Southern Border Wall to proceed. Big WIN for Border Security and the Rule of Law!”
The ruling came on the same day that Mr. Trump signed an agreement with Guatemala that was intended to slow the flow of Central American migrants seeking refuge in the United States. Migrants who travel north through Guatemala will be required to seek asylum there first.
The border wall case, Trump v. Sierra Club, No. 19A60, concerned injunctions entered by a trial judge that blocked the transfer of military funds to wall construction. An appeals court refused to stay the trial judge’s ruling while it considered the administration’s appeal. The Supreme Court’s ruling on Friday allows construction to proceed while the litigation continues.
Dror Ladin, a lawyer with the American Civil Liberties Union, one of the groups behind the legal challenge, said the ruling was a temporary setback.
“We will be asking the federal appeals court to expedite the ongoing appeals proceeding to halt the irreversible and imminent damage from Trump’s border wall,” Mr. Ladin said. “Border communities, the environment, and our Constitution’s separation of powers will be permanently harmed should Trump get away with pillaging military funds for a xenophobic border wall Congress denied.”
Justice Breyer was the only member of the court to file an opinion. “This case raises novel and important questions about the ability of private parties to enforce Congress’s appropriations power,” he wrote. But the immediate issue for the court, he added, was merely whether to enter a stay of the trial court’s injunction.
Allowing construction to start, Justice Breyer wrote, could cause irreparable harm to the challengers and to the environment. On the other hand, he wrote, the administration could lose access to the funds if it did not finalize contracts by the end of September. The solution, he wrote, would be to let the government negotiate and sign contracts, but not start building.
“I would grant the government’s application to stay the injunction only to the extent that the injunction prevents the government from finalizing the contracts or taking other preparatory administrative action,” Justice Breyer wrote, “but leave it in place insofar as it precludes the government from disbursing those funds or beginning construction.”
In February, President Trump declared a national emergency along the Mexican border. The declaration followed a two-month impasse with Congress over funding to build his long-promised barrier wall, an impasse that gave rise to the longest partial government shutdown in the nation’s history.
After Congress appropriated only a fraction of what Mr. Trump had sought, he announced that he would act unilaterally to spend billions more.
Soon after, two advocacy groups represented by the A.C.L.U. — the Sierra Club and Southern Border Communities Coalition — sued to stop Mr. Trump’s plan to use money meant for military programs to build barriers along the border in what he said was an effort to combat drug trafficking.
Judge Haywood S. Gilliam Jr., of the United States District Court in Oakland, Calif., blocked the effort in a pair of decisions that said the statute the administration had relied on to justify the transfer did not authorize it.
“The case is not about whether the challenged border barrier construction plan is wise or unwise. It is not about whether the plan is the right or wrong policy response to existing conditions at the southern border of the United States,” Judge Gilliam wrote. “Instead, this case presents strict legal questions regarding whether the proposed plan for funding border barrier construction exceeds the executive branch’s lawful authority.”
A divided three-judge panel of the United States Court of Appeals for the Ninth Circuit, in San Francisco, refused to stay Judge Gilliam’s injunction while the court considered the government’s appeal.
The public interest, the majority said, “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.”
In urging the Supreme Court to intercede, Noel J. Francisco, the solicitor general, wrote that the plaintiffs’ “interests in hiking, bird watching and fishing in designated drug-smuggling corridors do not outweigh the harm to the public from halting the government’s efforts to construct barriers to stanch the flow of illegal narcotics across the southern border.”
Mr. Francisco argued that the lower courts had misread two provisions of a federal law in concluding that the transfer was not authorized. The law allows reallocation of money to address “unforeseen military requirements” where the expenditures had not already been “denied by Congress.” Mr. Francisco wrote that the drug enforcement measures were unforeseen when the Defense Department made its budget request and that Congress had never addressed the particular narcotics measures.
In response, the A.C.L.U. said that the central issue in the case was straightforward. The administration, the group wrote, “lacks authority to spend taxpayer funds on a wall that Congress considered and denied.”