President Donald Trump on Friday said, "I think there's a good chance we'll have to" declare a national emergency in order to appropriate the funds to build his border wall.

Trump wouldn't say he would definitely declare it, but he told reporters that such a declaration "would help the process."

The remarks came as a specially created committee in Congress is poised to spend the next two weeks trying to reach a compromise on border security before the current short-term government funding bill expires on Feb. 15.

If no deal is reached, then Trump could decide to either partially shut down the government for the second time this year, or potentially sign a bill funding federal agencies, and then use his executive powers to declare a national emergency on the southern border.

This could allow the president to commandeer funds that have already been appropriated by Congress for other purposes, such as disaster relief, and use them to pay for the construction of a wall.

But such a declaration would almost certainly be challenged in court. There, the administration could find it challenging to make the argument that the immigration situation on the southern border, which has not materially changed in several months, merits an emergency declaration only now, after Trump was unable to secure the needed funds from Congress.

Asked Friday if he was concerned about courts halting an emergency declaration, Trump replied, "we have very, very strong legal standing to win," adding it would be "very hard" for a court to enjoin the declaration.

Trump also declared several times that the wall was already being built. He was presumably referring to stretches of both new wall and replacement wall that were approved and paid for last year with 2018 funding, but which are slated to begin construction later this winter.

"We're building the wall, and we're building a lot of wall," the president said, "but I can do it a lot faster the other way."

It was unclear what impact statements like these, which imply that the purpose of the national emergency would be merely to speed up construction, might have on the legal argument for a national emergency, if Trump were to declare one and it were to be challenged in court.

Trump has so far drawn a hard line in negotiations with Congress, saying he will not accept anything short of billions of dollars designated for the construction of a wall on the U.S.-Mexico border.

House Speaker Nancy Pelosi has drawn a line, as well, telling reporters on Thursday, "there's not going to be any wall money in the legislation."

Recent polling shows little public support for Trump using a national emergency to access wall funds. According to a respected poll released Monday, only 34 percent of Americans back declaring a national emergency in order to use military funding for the wall, while almost twice as many respondents — 64 percent — oppose the idea.

Republican senators, including Marco Rubio of Florida and Chuck Grassley of Iowa, have also warned the president against declaring a national emergency. On Sunday, Rubio called it a "terrible idea."

But at least one of Trump's closest allies in the Senate, Lindsey Graham of South Carolina, appeared ready to make the case to his fellow Republicans that a national emergency wasn't merely an acceptable option, it was Trump's only option.

"Republicans need to get behind President Trump emergency declaration to build wall/barrier," Graham tweeted on Friday afternoon. "Looking like he has no other option."

The building of a border wall was one of Trump's core campaign promises in 2016, and his failure to do so could damage his support among his deeply loyal base. On the other hand, the past month's battle over wall funding, and the historically long government shutdown Trump forced when Congress refused to appropriate the funds, have also hurt the president's broader approval ratings.

— CNBC's Jacob Pramuk contributed to this article.