A border-wall prototype is taken down in February in San Diego. (Gregory Bull/AP)

The House will appeal a federal judge’s decision rejecting its lawsuit to block spending on President Trump’s plan to build a wall at the U.S.-Mexico border, joining a legal battle over constitutional powers that may be headed to the Supreme Court.

The House on Monday gave notice of its plans to U.S. District Judge Trevor N. McFadden of Washington, six days after the judge said he would toss out the House case, finding that one chamber of Congress lacks legal standing to sue the president.

McFadden’s decision was at odds with a May 24 ruling by a federal judge in California who temporarily blocked part of the Trump administration’s plan in response to lawsuits brought by border communities and environmentalists alleging it would use money Congress never appropriated for that purpose.

Trump has said that his administration will seek an expedited appeal of U.S. District Judge Haywood S. Gilliam Jr.’s ruling in the Northern District of California, putting the sides on a collision course in appeals courts on both coasts.

At issue in both cases is whether the administration is violating the constitutional separation of powers between branches of the government by tapping $1 billion already transferred from military pay and pension accounts, as well as money from an emergency military construction fund that the administration said it intends to transfer but has not yet moved.

The House filed suit April 5 after House Speaker Nancy Pelosi (D-Calif.) accused the administration of “stealing from appropriated funds” by seeking to transfer $6.7 billion more for the effort than the $1.375 billion Congress approved.

Trump declared a national emergency in February to redirect mostly military-designated funding for the wall along the U.S.-Mexico border after losing a grueling two-month budget battle capped by a 35-day government shutdown.

McFadden’s ruling did not reach the merits of the House arguments. He acknowledged that the case “presents a close question,” while saying the Constitution provides the House with levers other than a lawsuit to use against the executive, including specifically denying funds, passing other legislation, conducting hearings and investigations, and overriding a president’s veto.

In California, Gilliam ruled in lawsuits brought by the Sierra Club and the Southern Border Communities Coalition that the administration cannot use transferred funds and blocked projects slated for immediate construction.

The decision applies to wall segments around Yuma, Ariz., and El Paso. With some contracts already awarded for construction, Gilliam said, allowing work to go forward before the legal issues have been fully resolved could cause irreparable harm.

He also said plaintiffs can come back to seek injunctions if the Trump administration announces additional projects at the border.