A federal judge in Northern California prohibited President Donald Trump from shifting $2.5 billion in military funding toward building the border wall in California, Arizona, and New Mexico. U.S. District Court Judge Haywood Gilliam in Oakland, California said that the effort by the Trump administration to shift money from the Defense Department toward the wall was “unlawful.” The judge had previously temporarily ordered a halt to the transfer of funds but now issued a permanent injunction against it. Gilliam issued his decision on two lawsuits Friday, one by the ACLU on behalf of the Sierra Club and the Southern Border Communities Coalition and another by California and 19 other states.*

The Trump administration has said that the use of the funds was lawful because it involves a national emergency. But Gilliam wrote that the administration’s attorneys “present no new evidence or argument for why the court should depart from its prior decision, and it will not.” He also said that those suing against the use of the funds would suffer “irreparable harm” from the construction of the wall.

Those opposed to the border wall celebrated Gilliam’s ruling. “These rulings critically stop President Trump’s illegal money grab to divert $2.5 billion of unauthorized funding for his pet project,” California Attorney General Xavier Becerra said in a statement. “All President Trump has succeeded in building is a constitutional crisis, threatening immediate harm to our state.” The ACLU also celebrated the decision saying that the judge makes clear the president can’t simply circumvent Congress. “This decision upholds the basic principle that the president has no power to spend taxpayer money without Congress’ approval,” Dror Ladin, staff attorney with the ACLU, said. “We will continue to defend this core principle of our democracy, which the courts have recognized for centuries.”

The fight, however, is far from over. Trump called the ruling a “disgrace” during a news conference Saturday in Japan. “So we’re immediately appealing it and we think we’ll win the appeal,” the president said. “There was no reason that that should have happened. And a lot of wall is being built.” Trump had previously criticized Gilliam when he issued the preliminary injunction last month, characterizing him as “another activist Obama appointed judge.”

Another activist Obama appointed judge has just ruled against us on a section of the Southern Wall that is already under construction. This is a ruling against Border Security and in favor of crime, drugs and human trafficking. We are asking for an expedited appeal! — Donald J. Trump (@realDonaldTrump) May 25, 2019

Correction on June 29 at 6:30 p.m.: This piece initially and incorrectly said the permanent injunction against the transfer of funds for the border wall was issued in response to the two lawsuits.