His ruling was the first of several lawsuits against Mr Trump’s controversial decision to bypass the normal appropriations process to pay for his long-sought wall.

“The position that when Congress declines the Executive’s request to appropriate funds, the Executive nonetheless may simply find a way to spend those funds ‘without Congress’ does not square with fundamental separation of powers principles dating back to the earliest days of our Republic,” the judge wrote in granting a temporary injunction to stop construction.

At stake is billions of dollars that would allow Mr Trump to make progress in a signature campaign promise heading into his campaign for a second term.

Mr Trump declared a national emergency in February after losing a fight with the Democratic-led House over fully paying for the wall that led to a 35-day government shutdown.

This is a win for our system of checks and balances, the rule of law, and border communities.

The court blocked all wall projects currently slated for immediate construction.

If the Trump administration begins illegally diverting additional funds, we'll be back in court.

As a compromise on border and immigration enforcement, Congress set aside 1.375 billion US dollars (£1.08 billion) to extend or replace existing barriers in Texas’ Rio Grande Valley, the busiest corridor for illegal crossings.

Mr Trump grudgingly accepted the money, but he declared the emergency to siphon money from other government accounts because he wanted to spend 8 billion dollars (£6 billion) on wall construction.

The president’s adversaries say the emergency declaration was an illegal attempt to ignore Congress, which authorised far less wall spending than Trump wanted.

“We welcome the court’s decision to block Trump’s attempts to sidestep Congress to build deadly walls that would hurt communities living at the border, endanger wildlife, and have damaging impacts on the environment,” said Andrea Guerrero, a member of the Southern Border Communities Coalition.

Trump declared a national emergency in February after losing a fight with the Democratic-led House over fully paying for the wall that led to a 35-day government shutdown (AP Photo/Matt York, File)

The administration said Mr Trump was protecting national security as unprecedented numbers of Central American asylum-seeking families arrive at the US border.

The courtroom showdowns come amid a flurry of activity to accelerate wall construction.

Kenneth Rapuano, an assistant secretary of defence, said in a court filing last month that work on the highest-priority, Pentagon-funded projects could begin as soon as Saturday.