The Pentagon is preparing in case President Donald Trump orders the military to build the southern wall, according to a defense official.

Trump has hinted in recent days that he may do so, amidst an impasse in negotiations with Democrats that has shut down the government.

“I may declare a national emergency dependent on what’s going to happen over the next few days,” Trump told reporters on Sunday.

While no order has been given, the Pentagon has been making plans just in case such an order comes down, the official said on Monday.

The idea of declaring a national emergency to have the military build the wall has been considered since fall, the official revealed.

Some money could come from unobligated funds for military construction projects in 2019, the official said. “Unobligated” means that the funds have been authorized for a certain purpose, but for whatever reason, have not yet been used.

The Army Corps of Engineers would likely be in charge of overseeing the construction.

The organization would not build the wall itself, but would subcontract the project out, and then inspect it to make sure it meets specification and Defense Department standards.

While most Democrats have claimed Trump did not have the authority to order the military to build the wall, Chairman of the House Armed Services Committee Adam Smith (D-WA) acknowledged Sunday that the president does have the authority.

“There is a provision in law that says the president can declare an emergency. It’s been done a number of times. But primarily it’s been done to build facilities in Afghanistan and Iraq,” he said Sunday on ABC’s “This Week.”

A Pentagon spokesman told reporters in December in response to queries: “Congress has provided options under Title 10 U.S. Code that could permit the Department of Defense to fund border barrier projects, such as in support of counter drug operations or national emergencies.”

Acting Defense Secretary Patrick Shanahan is unlikely to oppose any such order for the military to build the wall.

After a Cabinet meeting last week on the border, he praised the Army Corps of Engineers for its work so far in restoring fences and the “building out of additional mileage for the wall.”

“The Army Corps of Engineers is dialed in on doing this cost-effectively, quickly, and with the right amount of urgency as to where we can build additional standup walls quickly and then get after the threat. The threat is real. The risks are real. We need to control our borders,” he said.

But Smith and a number of other Democrats say they are opposed to the idea, and that Trump would be open to legal challenges.

“In this case, I think the president would be wide open to a court challenge saying, where is the emergency? You have to establish that in order to do this. But beyond that, this would be a terrible use of Department of Defense dollars.”

The president is slated to give a nationwide Oval Office address on Tuesday evening on the border situation, and is expected to travel to the border on Thursday.

Defense officials say they will be monitoring to see if a declaration of national emergency comes during those events this week.

Separately, the Department is slated to announce an extension of troops serving at the border by the end of this week.

Military support to the border was extended through January 31 by former Defense Secretary Jim Mattis, and it is expected to be extended again.

There are approximately 5,000 who are helping border patrol agents secure the border. Trump ordered the deployment ahead of at least two migrant caravans that were headed to the United States from Central America.