CNN  — 

A federal judge in California ruled against the Trump administration on Friday in two different cases, ultimately preventing $2.5 billion in federal funds from being used for a border wall in portions of California, New Mexico and Arizona.

In the first case, US District Court for Northern California ruled in favor of a challenge to President Donald Trump’s attempt to move billions from the Defense Department budget toward building a border wall in El Centro, California, and New Mexico.

Trump’s move was done as part of his national emergency declaration in February.

California Attorney General Xavier Becerra – who has led a group of states in a separate lawsuit against the administration’s push for border wall funding – celebrated the decision Friday, which he said permanently stops the administration from proceeding with construction on the wall.

“These rulings critically stop President Trump’s illegal money grab to divert $2.5 billion of unauthorized funding for his pet project,” Becerra said. “All President Trump has succeeded in building is a constitutional crisis, threatening immediate harm to our state. President Trump said he didn’t have to do this and that he would be unsuccessful in court. Today we proved that statement true.”

The Department of Justice declined to comment to CNN on the rulings. CNN has also reached out to the White House.

Judge Haywood Gilliam determined in the ruling that “no new factual or legal arguments persuade the Court that its analysis” in May to block funds from going to a border wall is incorrect. As a result, “plaintiffs’ likelihood of success on the merits has ripened into actual success,” he added.

In a second lawsuit against the administration brought by the American Civil Liberties Union on behalf of the Sierra Club and the Southern Border Communities Coalition, Gilliam ruled against the administration a second time.

He ruled that the administration was instructed to keep from “taking any action to construct a border barrier” on the six border sites addressed in the lawsuit.

Gilliam determined in the ruling that the environmental rights groups demonstrated that they would “suffer irreparable harm to their members’ aesthetic and recreational interests” should a border wall be built. He added that lawmakers properly addressed immigration in their proposed border funding bill to end the shutdown.

“Congress considered all of Defendants’ proffered needs for border barrier construction, weighed the public interest in such construction against Defendants’ request for taxpayer money, and struck what it considered to be the proper balance – in the public’s interest – by making available only $1.375 billion in funding, which was for certain border barrier construction not at issue here,” he wrote.

Dror Ladin, a staff attorney with the ACLU’s National Security Project who argued the case, said in a statement that “Congress was clear in denying funds for Trump’s xenophobic obsession with a wasteful, harmful wall.”

“This decision upholds the basic principle that the President has no power to spend taxpayer money without Congress’ approval,” he added. “We will continue to defend this core principle of our democracy, which the courts have recognized for centuries.”

CORRECTION: This story has been updated to reflect the judge’s Friday ruling instructed the administration to keep from “taking any action to construct a border barrier” on six border sites in California, New Mexico and Arizona, and that California Attorney General Xavier Becerra led a group of states in a separate lawsuit involving border funding.