A federal judge in California ruled on Wednesday that the Trump administration could not use military funds for border wall construction.

Judge Haywood Gilliam Jr. of the U.S. District Court for the Northern District of California, an Obama appointee, ruled that the administration's plan to reallocate defense funding to a series of border construction projects is unlawful.

Gilliam said in his decision that it appeared that the administration had tried to use military funds to circumvent congressional approval, writing that "the border barrier projects Defendants now assert are 'necessary to support the use of the armed forces' are the very same projects Defendants sought — and failed — to build under [the Department on Homeland Security's] civilian authority, because Congress would not appropriate the requested funds."

ADVERTISEMENT

It's the second such ruling in as many days, coming just after a federal judge in Texas similarly ruled in favor of a lawsuit brought by El Paso and a nonprofit.

After the president signed a funding bill in February that didn't include all of the $5.7 billion that he had requested for border wall construction, he signed an executive action declaring a national emergency at the southern border that required the use of the armed forces.

Gilliam's ruling came in a pair of cases — one brought by California and the other by the American Civil Liberties Union (ACLU) on behalf of the Sierra Club — challenging the president's move.

“We applaud the court for declaring unlawful President Trump Donald John TrumpBiden says voters should choose who nominates Supreme Court justice Trump, Biden will not shake hands at first debate due to COVID-19 Pelosi: Trump Supreme Court pick 'threatens' Affordable Care Act MORE’s desperate attempt to divert money from important military construction projects to build his unnecessary border wall Congress refused to fund," California Attorney General Xavier Becerra Xavier BecerraState AGs condemn HUD rule allowing shelters to serve people on basis of biological sex OVERNIGHT ENERGY: Trump casts doubt on climate change science during briefing on wildfires | Biden attacks Trump's climate record amid Western wildfires, lays out his plan | 20 states sue EPA over methane emissions standards rollback 20 states sue EPA over methane emissions standards rollback MORE said in a statement. "This is a critical victory that sends a strong message to the White House: you are not above the law.”

“This ruling confirms that the president has no authority to raid military construction funds for his xenophobic wall,” Dror Ladin, an attorney with the ACLU’s National Security Project, said in a statement. “By putting an end to the president’s power grab, this ruling protects our democracy’s separation of powers, the environment, and border communities.”

The White House and Department of Justice did not immediately respond when asked for comment.

—Updated at 3:41 p.m.