A child resident of Ciudad Juarez looks through the bars of a wall from the side of Ciudad Juarez, Mexico, through to El Paso on May 25. (Jose Luis Gonzalez/Reuters)

A federal judge on Friday expanded a ban on construction of President Trump’s signature southern border wall that would have used money to build a wall that Congress never appropriated.

U.S. District Judge Haywood S. Gilliam Jr., of Oakland, Calif., blocked construction on four of the administration’s highest-priority projects on the U.S.-Mexico border spanning 79 miles near El Centro, Calif., and Tucson. The Pentagon had moved to fund the projects using $1. 5 billion transferred into a Defense Department counterdrug program from military pay and training accounts.

In his order granting a permanent halt on the construction, Gilliam also cleared the path for an immediate appeal.

Gilliam last month in part of the same case temporarily stopped another $1 billion transfer for work on stretches totaling 50 miles in eastern New Mexico and Yuma, Ariz.

But he signaled then that environmentalists and border communities covered in Friday’s ruling were likely to prevail in their claims that the administration illegally shifted money that Congress never intended or approved for the wall.

Gilliam last month cited “Congress’s ‘absolute’ control over federal expenditures — even when that control may frustrate the desires of the executive branch,” and on Friday saw no reason to reverse course.

“Defendants do not have the purported statutory authority to reprogram and use funds for the planned border barrier construction,” Gilliam wrote. He acknowledged the government’s “strong interest in border security,” but said, “Absent such authority, Defendants’ position on these factors boils down to an argument that the Court should not enjoin conduct found to be unlawful because the ends justify the means. No case supports this principle.”

Gilliam’s latest 11-page opinion delivered a victory to the Sierra Club and Southern Border Communities Coalition, represented by the American Civil Liberties Union, which had argued the wall would irreparably harm “recreational and aesthetic interests” in desert expanses that include national monuments, wildlife refuge and reserves and rivers, they said.

Together with the U.S. Justice Department, both sides had asked Gilliam to speed up his ruling and enter final judgment so one of the president’s signature initiatives could quickly go before the U.S. Court of Appeals for the 9th Circuit.

A Justice Department spokeswoman did not immediately respond to a request for comment late Friday.

However, earlier in the day, attorneys for the Justice Department and ACLU notified Gilliam that the government had said it planned to move ahead by Monday on the El Centro and Tucson border barrier projects and asked Gilliam if he intended to rule before then, so if he didn’t they could file emergency motions over the weekend.

In all, Gilliam’s rulings blocked $2.5 billion of the $6.7 billion that the administration planned to transfer for the effort beyond the $1.375 billion Congress allotted last winter.

When Congress declined to sign off on spending at the levels sought by the president, Trump eventually invoked several statutes he claimed allowed him to repurpose appropriations meant for other projects and spend the money on wall construction. One of those laws, so far unused by the administration, required Trump to declare a national emergency. The others did not.

Gilliam said the administration’s plan to transfer counterdrug funding appeared to be illegal because the law the administration invoked applies only to “unforeseen” needs, whereas Trump had demanded funding since early 2018 and even in his campaign.

“We applaud the court’s decision to protect our Constitution, communities, and the environment today,” said Gloria Smith, managing attorney at the Sierra Club. “Walls divide neighborhoods, worsen dangerous flooding, destroy lands and wildlife, and waste resources that should instead be used on the infrastructure these communities truly need.”

“Congress was clear in denying funds for Trump’s xenophobic obsession with a wasteful, harmful wall,” said Dror Ladin, staff attorney with the ACLU’s National Security Project. “This decision upholds the basic principle that the president has no power to spend taxpayer money without Congress’s approval.”

On a separate legal challenge to wall funding, U.S. District Judge Trevor N. McFadden in Washington, D.C., in May tossed out a lawsuit by the Democrat-led House of Representatives to block the spending transfers, arguing that Trump unconstitutionally diverted appropriated funds in violation of Congress’s power of the purse. The House has appealed that case to the U.S. Court of Appeals for the D.C. Circuit.

Correction: An earlier version of this article erroneously stated that the court banned the use of money secured under President Trump's declaration of a national emergency. In fact, the transfers involved in the case, while announced at the same time as the declaration, were not dependent on it.