President Donald Trump on Tuesday said he would be willing to shut down the government in order to get the funding needed for his proposed border wall.

"If we have to close down our government, we're building that wall," Trump said at a rally in Arizona.

If Congress does not reach a funding deal that the president signs into law by a Sept. 30 deadline, the government will shut down. Congressional Democrats have explicitly said they will not support a deal that includes money for the wall.

Trump could, in theory, veto or choose not to sign a spending measure that Congress passes without funding for the barrier, causing a shutdown.

As a candidate, the president pledged to build a physical barrier along the entire U.S.-Mexico border as part of his push to crack down on illegal immigration. He pledged that Mexico would fund the project, but America's southern neighbor quickly quashed that idea.

The White House has sought federal funding for the wall, which is spending Democrats have pledged not to back in a bill. The majority Republicans will need the minority party's votes to keep the government open.

Lawmakers whose districts sit along the border, including Republicans, have questioned the effectiveness of a physical wall.