President Trump said Wednesday he is "willing to do anything," including shut down the federal government, to secure adequate funding for his border wall this fall.

"If it's about border security, I'm willing to do anything," Trump told reporters at the White House when asked about the possibility of a shutdown at the end of the month. "We have to protect our borders. If we don't protect our borders, our country isn't going to be a country anymore. So if it's about border security, I'm willing to do what has to be done."

On temporarily closing down the federal government, he added: "If it happens it happens."

The president has previously threatened to allow a government shutdown if Congress fails to provide enough funding to construct a significant portion of the border wall he promised to build as a candidate.

White House officials are currently working to persuade House Republicans to push for $23 billion in funding for a barrier between the U.S. and Mexico before an Oct. 1 spending deadline.

But Trump is also said to be considering a partial shutdown that would involve signing a stand-alone bill to fund most of the government, while holding off on approving additional spending measures that exclude sufficient wall funding.

"It hasn't been ruled out, but it hasn't been ruled in either," a senior administration official told CNBC last week.

Lawmakers have fewer than 10 legislative days left on the calendar before the deadline arrives for spending legislation.

[Opinion: Instead of threatening shutdown over border wall, Trump should have claimed victory on spending agreement]