A federal judge on Friday expanded a ban on construction of President Donald Trump’s signature southern border wall that would have used money secured under his declaration of a national emergency, but that Congress never approved for the purpose.

US District Judge Haywood S Gilliam Jr, of Oakland, California, blocked construction on four of the administration’s highest-priority projects on the US-Mexico border spanning 79 miles near El Centro, California, and Tucson.

The Pentagon had moved to fund the projects using $1.5bn (£1.18bn) transferred into a Defence Department counter-drug programme from military pay and training accounts.

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

Mr Gilliam last month in part of the same case temporarily stopped another $1bn (£787 million) transfer for work on stretches totalling 50 miles in eastern New Mexico and Yuma, Arizona.

Trump prototypes for Mexico border wall demolished in California Show all 20 1 /20 Trump prototypes for Mexico border wall demolished in California Trump prototypes for Mexico border wall demolished in California The prototypes for President Trump’s border wall are being demolished. AP Trump prototypes for Mexico border wall demolished in California The US Customs and Border protection had built the eight 30-foot tall steel and concrete models near San Diego on the US-Mexico border. Reuters Trump prototypes for Mexico border wall demolished in California A 2018 report from the Government Accountability Office found that the construction challenges presented by the four concrete models would be “extensive” and those presented by two of the other models would be “substantial”. Reuters Trump prototypes for Mexico border wall demolished in California It was intended that Mr Trump would choose his favourite of the designs after testing had been completed. AFP/Getty Trump prototypes for Mexico border wall demolished in California The President is yet to comment. AFP/Getty Trump prototypes for Mexico border wall demolished in California Each prototype cost $300,000 to $500,000 to build and they are being knocked down in order to make way for the San Diego Secondary Wall project which will see up to 14 miles of barrier being built to support the existing steel border fence. AP Trump prototypes for Mexico border wall demolished in California The new barrier will not employ the design of any of the prototypes, instead being built of the favoured steel bollards which make up the current section of the wall at San Diego. Reuters Trump prototypes for Mexico border wall demolished in California The new secondary barrier being built near San Diego. Reuters Trump prototypes for Mexico border wall demolished in California The rubble of one of the demolished prototypes. Reuters Trump prototypes for Mexico border wall demolished in California A steel wall prototype AFP/Getty Trump prototypes for Mexico border wall demolished in California A wall prototype made from a mix of steel and concrete AFP/Getty Trump prototypes for Mexico border wall demolished in California A wall prototype made from a mix of steel and concrete AFP/Getty Trump prototypes for Mexico border wall demolished in California A concrete wall prototype AFP/Getty Trump prototypes for Mexico border wall demolished in California A steel wall prototype AFP/Getty Trump prototypes for Mexico border wall demolished in California A concrete wall prototype AFP/Getty Trump prototypes for Mexico border wall demolished in California A concrete wall prototype AFP/Getty Trump prototypes for Mexico border wall demolished in California A concrete wall prototype AFP/Getty Trump prototypes for Mexico border wall demolished in California A digger approaches the prototype wall AFP/Getty Trump prototypes for Mexico border wall demolished in California Aerial view of the wall prototypes at the US-Mexico border after they were torn down AFP/Getty Trump prototypes for Mexico border wall demolished in California An aerial view showing Tijuana, Mexico on the left and the demolished wall prototypes on the right AFP/Getty

But he signalled 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.

Mr Gilliam last month cited “Congress’ ‘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,” Mr 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.”

Mr 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 (ACLU), 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 US Justice Department, both sides had asked Mr Gilliam to speed up his ruling and enter final judgment so one of the president’s signature initiatives could quickly go before the US Court of Appeals for the 9th Circuit.

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

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

In all, Mr Gilliam’s rulings blocked $2.5bn (£1.97bn) of the $6.7bn (£5.28bn) that the administration planned to transfer for the effort beyond the $1.375bn (£1.08bn) Congress allotted last winter.

When Congress declined to sign off on spending at the levels sought by the president, Mr Trump eventually declared a national emergency in February to redirect mostly military-designated funding to pay for the project.

Mr Gilliam said the administration’s plan to transfer counter-drug 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.

Trump says border wall would have prevented father and daughter from drowning in Rio Grande

“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 neighbourhoods, 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, US District Judge Trevor McFadden in Washington DC, in May tossed out a lawsuit by the Democrat-led House of Representatives to block the spending transfers, arguing that President Trump unconstitutionally diverted appropriated funds in violation of Congress’s power of the purse.

The House has appealed that case to the US Court of Appeals for the DC Circuit.