A group of 16 states has filed a lawsuit in a Northern California federal court against President Trump's declaration of a national emergency, calling the president's decision to use executive power to fund a border wall unconstitutional.

The complaint filed Monday in the U.S. District Court for the Northern District of California seeks to bar the administration from using emergency powers to divert money from other programs to a wall on the U.S.-Mexico border, marking the start of a legal battle anticipated by both the president and his opponents.

"The President has used the pretext of a manufactured 'crisis' of unlawful immigration to declare a national emergency," the plaintiffs wrote in California et al. v. Trump et al. The lawsuit, spearheaded by California Attorney General Xavier Becerra, says that the Constitution gives Congress alone the power to control spending, not the president.

Trump declared the emergency on Friday to free up billions of dollars for construction of a long-promised border wall, after Congress passed a spending bill that allocated just $1.375 billion for its construction. The president says he plans to allocate a total of $8 billion to the wall, including redirecting $3.6 billion in military construction funds and $2.5 billion from the Department of Defense's counter-drug activities.

Trump acknowledged the likelihood of legal challenges, saying on Friday, "We will possibly get a bad ruling, and then we'll get another bad ruling, and then we'll end up in the Supreme Court, and hopefully we'll get a fair shake."

States have pointed to the president's own words to say there is no national emergency. Becerra spoke with NPR's All Things Considered on Friday about his plans to sue the administration.

"[Trump] said, 'I didn't need to do this.' Those are not the kind of words you hear from a president who's about to declare a national emergency," Becerra said.

The White House has argued that the move is routine. According to the Brennan Center for Justice, presidents have declared national emergencies 60 times, including Trump, since the power was codified in the National Emergencies Act of 1976.

But Democratic critics, including House Speaker Nancy Pelosi and Senate Minority Leader Chuck Schumer, have advanced the same argument as the California-led lawsuit, claiming Trump's declaration violates lawmakers' power to set spending priorities.

Experts seem to think the courts are likely to defer to the president on the question of whether there is an emergency, NPR's Nina Totenberg has reported, and the legal fight is likely to boil down to whether the president has the right under existing law to "reprogram" money Congress has appropriated.

This coalition of states in the lawsuit also includes Colorado, Connecticut, Delaware, Hawaii, Illinois, Maine, Maryland, Michigan, Minnesota, Nevada, New Jersey, New Mexico, New York, Oregon and Virginia. The group includes two of the four states located along the southern border, California and New Mexico. All but one of the states, Maryland, have Democratic governors.

The lawsuit alleges that redirecting funds from drug interdiction, military construction projects and law enforcement initiatives toward a wall would cause "significant harm" to the public safety, financial well-being and natural resources of the plaintiff states and their residents.

"There are a number of very important military projects, Army Corps of Engineers projects, that would be robbed of money to continue to move forward," Becerra told NPR on Friday.

The plaintiffs also write that there is "no national emergency at the southern border that warrants construction of a wall," citing Customs and Border Protection data that show a decrease in border crossings. In fact, illegal border crossings in the most recent fiscal year (ending in September 2018) were lower than in either 2016 or 2014 and much lower than at their peak around 2000, as NPR has previously reported.

The administration can expect numerous legal challenges from other groups, several of which have already been filed. Two landowners in Texas who would be impacted by the border wall told NPR they are suing the government. And the American Civil Liberties Union has announced that it will also file a lawsuit.

Demonstrators took to the streets in several cities on Monday to protest the national emergency declaration, including a gathering across the street from the White House in Washington.

Copyright 2019 NPR. To see more, visit https://www.npr.org.