Two weeks into a partial government shutdown triggered by an impasse over the money President Donald Trump demanded for his promised border wall, Trump said he could declare a state of emergency and build his wall without congressional approval.

"I can do it if I want," he told reporters at the White House on Friday. "We can call a national emergency because of the security of our country. We can do it. I haven't done it, I may do it."

Is that true? Legal experts said it might not be as simple to bypass Congress — which ultimately controls the federal budget — as Trump suggests, but not necessarily impossible. NBC News reported Friday that lawyers from the White House, the Department of Homeland Security and the Pentagon are meeting to discuss whether or not it's doable.

"We're in uncharted territory," said University of Texas School of Law Professor Stephen Vladeck in an interview Friday evening.

What's a national emergency?

A president can declare that the country is in a state of national emergency at his discretion. The declaration confers a set of special executive authorities that are designed to give the president the power to effectively handle emergencies, such as an outbreak of war.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

How could Trump get his wall money by declaring one?

Experts in executive authority told NBC News that while Trump can declare an emergency, his powers — and the funds he has access to once he's done so — are unclear.

“He can declare some kind of national emergency, but what it would allow him to do legally is a totally different question,"said Matt Dallek, professor at George Washington University’s Graduate School of Political Management and an expert in presidential power.

Any moves like the one Trump teased on Friday would "certainly" meet with a legal challenge, he added, and the courts have stopped presidents from using states of emergency before. For instance, President Harry Truman tried to nationalize the country's steel industry citing a state of emergency because of the Korean War, Dallek recalled, but the Supreme Court ruled Truman didn't have the authority.

Dallek said he believes the president will run afoul of the courts because in order for Trump to be in the clear, Congress legally still needs to earmark any federal funds for a border wall.

But legal experts said Trump could find surer footing by using "un-obligated" money within the Defense Department's budget, because federal law allows the military to fund construction projects during war or emergencies. A Pentagon spokesman said in December 2018 that Title 10 of the U.S. Code could give the military the authority to fund border barrier projects under certain circumstances.

"The Department of Defense has funds in its account that are not specifically designated for anything. Congress gives them money and says we don't know what’s going to happen over the next year — here’s 100 billion," Harvard Law School Professor Mark Tushnet told NBC News, guessing at an approximate funding amount.

“My instinct is to say that if he declares a national emergency and uses this pot of unappropriated money for the wall, he’s on very solid legal ground,” he added.

Vladeck said those legal codes do allow construction projects, but they were conceived to let the military build structures during war when there wasn't time for a Congressional appropriation, for instance, and it’s unclear how much money is available.

"DoD has a big pile of money for military construction, the question is whether DoD would use that money and might even cancel other construction projects just to build the wall,” Vladeck said, noting that funds can become "un-obligated” if the military cancels other projects.

At the end of the day, however, Vladeck said, much of what Trump can do may depend on how it plays in the political arena.

"The checks here are principally political, not legal," Vladeck said of Trump's claim. “These are areas where I think Congress has delegated far more power to the president than I think we’re all necessarily comfortable with. The assumption has been there are political safeguards on such things, that doing it would be so politically unattractive that even if you had the bare legal authority to do it, the political costs would be too high.”