WASHINGTON – President Donald Trump will declare a national emergency to speed up funding for his proposed wall on the U.S.-Mexican border, but experts said the move would create a legal morass that could take until the middle of next year to resolve.

The White House announced Thursday that Trump will make the move that he'd suggested for weeks. The announcement came as Congress readied legislation that would devote $1.375 billion to the border wall, far less than the $5.7 billion Trump demanded.

Declaring an emergency would let Trump sidestep Democratic opposition to more wall funding, but it could draw legal challenges from lawmakers and others who viewed the move as a power grab. Although that could delay construction of his border barriers, an extended legal battle would give Trump a potent political issue to run on in the 2020 presidential election.

"Everyone’s going to come out of the woodwork," said Stephen Vladeck, a University of Texas-Austin law professor who teaches national security law. "I think we’re going to see an array of lawsuits that actually would all have to be dealt with separately."

More:How congressional Democrats could fight a Trump wall emergency declaration

More:What to know about national emergencies and their role in US history

White House spokeswoman Sarah Sanders said the administration is "very prepared" for legal challenges.

The potential for an extended legal battle may explain why Trump backed away from the emergency scenario last month. The president, who faced criticism from some Republicans for the idea, said he wouldn't declare an emergency imminently. Republicans noted a future Democratic president could also use an emergency to work around Congress.

Litigation could go all the way to the Supreme Court, which has smacked down attempts by both Trump and President Barack Obama to make end runs around Congress. How long that takes would depend on several factors:

• Which programs the White House might try to tap for funding.

• Whether Trump tries to speed the seizure of property from unwilling owners.

• Who could be harmed by the order and would have the right to sue.

• What court or courts are chosen by challengers seeking favorable verdicts.

For weeks, Trump weighed invoking a national emergency as the political impasse over the wall led to a partial government shutdown that became the longest in U.S. history. White House aides acknowledged that lawyers reviewed the ramifications.

The president expressed confidence in the legal strategy. "The law is 100 percent on my side," he said.

Democrats blasted the move. House Speaker Nancy Pelosi and Senate Minority Leader Charles Schumer called the decision a "gross abuse of the power of the presidency" in a joint statement.

Legal experts differed over how much latitude Trump would have to free up money for the wall on his own. They cautioned that those who favor an emergency declaration may trade a deadlock in Congress for a lengthy legal fight in the federal judiciary.

Walter Dellinger, an assistant attorney general and head of the Office of Legal Counsel under President Bill Clinton, said a lawsuit could reach the Supreme Court in a matter of months but probably would not be resolved quickly.

“I think that a clear majority of the Supreme Court will be deeply troubled by the invocation of emergency authority in this case,” Dellinger said. "In the normal course, we might not expect a decision until June of 2020 at the earliest."

Presidents have broad authority to declare an emergency but are more restricted in how they can use it. White House officials zeroed in on provisions that would let Trump capture unused money Congress set aside for other purposes.

“None of these statutes is a blank check," Vladeck said.

Another question that would have to be decided early in the process: Who has the right to sue? Lawmakers might sue by arguing the president usurped their power through an emergency declaration. Homeowners on the border whose property could be seized to build the wall also might have a case, experts said.

Litigation may turn in part on whether Trump erred in declaring an emergency in the first place. Though the president described the situation on the border as a "security and humanitarian crisis," the number of people apprehended attempting to cross the border illegally has fallen considerably over the past decade.

Courts have traditionally given presidents leeway to decide matters of national security.

"There’s just not a lot of guidance in these statutes about what actually constitutes a national emergency," said Margaret Taylor, senior editor and counsel at the legal blog Lawfare and a former Democratic aide on the Senate Foreign Relations Committee. "Congress and the courts have been deferential to presidents on that decision."

On the other hand, presidents have faced successful challenges after they took action to sidestep Congress. Obama's effort to shield from deportation about 5 million undocumented immigrants through an executive order faced a high-profile lawsuit from Texas that dragged on for months before the Supreme Court killed the program.

Challengers presumably would bring their lawsuits to district court judges they considered likely to look askance at Trump’s action – a practice known as “forum shopping” that’s used by both liberals and conservatives to improve their chances. Liberals often file cases within the jurisdiction of the U.S. Court of Appeals for the 9th Circuit, based in California; conservatives often opt for the 5th Circuit, which includes Texas.

Signaling that he may have learned from the extended legal challenge that for months blocked his travel ban on predominately Muslim countries, Trump predicted opponents might try to bring a challenge to an emergency declaration in the 9th Circuit.

"What will happen? I'll be sued. It'll be brought to the 9th Circuit. We'll probably lose there, too," Trump said. "And then hopefully we'll win in the Supreme Court."