President Donald Trump's declaration of an emergency Friday to build a border wall immediately drew legal challenges that could easily escalate into a landmark test of the balance of power between the White House and Congress.
Legal experts said it was "unprecedented" for a president to use his emergency powers to overcome Congress's refusal to fund his wishes, in this case a barrier on the US-Mexican border to keep out illegal immigrants.
They also questioned Trump's categorisation of the immigration issue as a national emergency and his tapping military funds for a non-military project.
Hours after the announcement, the Trump administration faced an investigation by the House Judiciary committee and lawsuits from New York, California and the American Civil Liberties Union.
"President Trump is manufacturing a crisis and declaring a made-up 'national emergency' in order to seize power and subvert the constitution," said California Governor Gavin Newsome.
"California will see you in court."
President Trump said he expected a legal fight and predicted he would prevail.
"We will have a national emergency, and we will then be sued," he said Friday.
"Then we will end up in the Supreme Court, and hopefully we will get a fair shake, and we'll win in the Supreme Court."
Mr Trump invoked the 1976 National Emergencies Act after Congress refused to allocate his requested $5.7 billion for a wall in a spending bill.
The White House says the emergency order empowers it to pull around $6.6 billion from other sources, mostly already-allocated funds in the Defense Department budget.
Democrats accused the president of an unconstitutional power grab.
"The president's actions clearly violate the Congress's exclusive power of the purse," Nancy Pelosi and Chuck Schumer, the Democratic leaders in Congress, said in a joint statement.
It is a precedent-setting move, said American University law professor Jennifer Daskal, adding that the National Emergencies Act had "never been used in that way, for good reason."
Critics warn that President Trump opened the door for future presidents to call on the act whenever they fail to get their way with Congress. A frustrated Democratic president might some day invoke it to get funds to fight ongoing "emergencies" of climate change and gun proliferation.
The White House dismissed this argument, underscoring how a court showdown might proceed.
"This actually creates zero precedent. This is authority given to the president in law already," said acting White House chief of staff Mick Mulvaney.
"It's not as if he just didn't get what he wanted, so he is waving a magic wand and taking a bunch of money."
Any legal battle will focus on the definition of "emergency".
The emergencies act "does not provide any explicit limitations on what does and does not constitute a national emergency," Daskal told AFP.
Previous governments have declared emergencies based on the act due to immediate threats such as the September 11, 2001 attacks and the 2009 outbreak of swine flu.
Mr Trump said the emergency now is the flow of drugs and violent criminals across the border.
In the abstract, he appears within his rights.
However, said Bobby Chesney, the associate dean at the University of Texas School of Law, "litigation won't be in abstract."
"The pretext issue looms large here," he said in a comment on Twitter.
He was referring to the problem of Mr Trump resorting to declaring the border issue an emergency after spending two years in a losing political battle for wall funding.
Mr Trump himself appeared to undermine his argument as he announced the emergency on Friday.
"I didn't need to do this, but I'd rather do it much faster," he said.
Ms Daskal expects border landowners also to sue to protect their property rights.
"A lot of the land that's at issue is not federal land, it's private land," she said.
Mr Chesney points to a challenge over the use of military funds. Defense Department rules say that, even if diverted, construction funds must be for a project that "requires the use of the armed forces."
The wall, however, has been cast from the outset as a civilian project.
"That is the main point of litigation vulnerability," said Mr Chesney.