A federal judge appointed by former President Barack Obama has partially blocked President Donald Trump’s plan to fund construction of his long-promised border wall.

The preliminary injunction, issued Friday by California U.S. District Court Judge Haywood Gilliam, reportedly bars the Pentagon from transferring $1 billion from counterdrug funding to expand or enhance border barriers. According to Politico, it also “appears to jeopardize another $1.5 billion of the $8.1 billion the administration planned to use for border construction.”

From the ruling:

[T]he Court hereby GRANTS IN PART and DENIES IN PART WITHOUT PREJUDICE Plaintiffs’ motion for a preliminary injunction. The terms of the injunction are as follows: Defendants Patrick M. Shanahan, in his official capacity as Acting Secretary of Defense, Kevin K. McAleenan, in his official capacity as Acting Secretary of Homeland Security, Steven T. Mnuchin, in his official capacity as Secretary of the Department of the Treasury, and all persons acting under their direction, are enjoined from taking any action to construct a border barrier in the areas Defendants have identified as Yuma Sector Project 1 and El Paso Sector Project 1 using funds reprogrammed by DoD under Section 8005 of the Department of Defense Appropriations Act, 2019.

The order only applies to the El Paso, Texas and Yuma, Arizona sectors and involved money “not contingent on [Trump’s] emergency declaration,” Politico reported.

Judge Gilliam’s injunction was issued in favor of the Southern Border Communities Coalition and the Sierra Club. The American Civil Liberties Union, which petitioned the judge on the groups’ behalf, called the injunction “a win for our system of checks and balances” and promised to go back to court to block any attempts to divert “additional military funds.” (RELATED: Christian Theologian Makes Case That God Supports Trump’s Border Wall)

Trump’s February national emergency declaration came after he failed to reach agreement with Democratic leaders for providing any specific border wall funding. The president vetoed a congressional disapproval resolution a month later, which was sustained.

“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,” Gilliam wrote.

Follow Scott on Twitter