His ruling was the first of several lawsuits against 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 Trump to make progress in a signature campaign promise heading into his campaign for a second term.
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.
As a compromise on border and immigration enforcement, Congress
set aside USD 1.375 billion to extend or replace existing barriers in Texas' Rio Grande Valley, the busiest corridor for illegal crossings.
Trump grudgingly accepted the money, but he declared the emergency to siphon money from other government accounts because he wanted to spend USD 8 billion on wall construction.
The funds include USD 3.6 billion from military construction funds, USD 2.5 billion from Defense Department counter-drug activities and USD 600 million from the Treasury Department's asset forfeiture fund.
The president's adversaries say the emergency declaration was an illegal attempt to ignore Congress, which authorized 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.
The administration said Trump was protecting national security as unprecedented numbers of Central American asylum-seeking families arrive at the U.S.
The courtroom showdowns come amid a flurry of activity to accelerate wall construction.
Kenneth Rapuano, an assistant secretary of defense, said in a court filing last month that work on the highest-priority, Pentagon-funded projects could begin as soon as Saturday.
The Defense Department has transferred USD 2.5 billion to border wall coffers.
The Defense Department transferred USD 1 billion to border wall coffers in March and another USD 1.5 billion earlier this month. Patrick Shanahan, the acting defense secretary, is expected to decide soon whether to transfer an additional USD 3.6 billion.
Last week, Southwest Valley Constructors of Albuquerque, New Mexico, won a USD 646 million award to replace 101 kilometers in the Border Patrol's Tucson, Arizona, sector. Barnard Construction Co.
of Bozeman, Montana, won a USD 141.8 million contract to replace 8 kilometers in Yuma and 24 kilometers in El Centro, California.
The administration has planned to use USD 601 million in Treasury money to extend barriers in the Rio Grande Valley.