President Donald Trump threatened a government shutdown over funding for his proposed wall along the Mexico-US border.

The plan would face opposition from Democrats and some Republicans.

It could also be politically costly for Trump to go all out to get funding for a physical border wall.

President Donald Trump wants his wall, and he's willing to shut down the government to get it.

During a wild campaign rally in Phoenix, Arizona, on Tuesday night, Trump made an explicit threat to shut down the federal government to secure funding for his proposed wall along the US-Mexico border.

"If we have to close down our government, we're building that wall," Trump said to applause.

Politico's Josh Dawsey reported that this wasn't an empty threat, either. Trump has told advisers over the past week that he wants "real money" to begin construction on the physical wall he repeatedly promised during the campaign.

Congress must pass a funding bill by the end of September to avoid a shutdown. With only 12 working days to do so, throwing in a fight over the wall won't make the arduous task any easier. Any funding for a physical structure along the border in a bill would most likely be a nonstarter with bipartisan opposition.

Democrats, who would be likely to universally oppose such a proposal, can block any funding bill in the Senate if they wish. In a statement Wednesday, Senate Minority Leader Chuck Schumer made it clear that would be the case.

"If the president pursues this path, against the wishes of both Republicans and Democrats, as well as the majority of the American people, he will be heading towards a government shutdown which nobody will like and which won't accomplish anything," Schumer said.

House Minority Leader Nancy Pelosi echoed Schumer.

"President Trump's multi-billion dollar border wall boondoggle is strongly opposed by Democrats and many Republicans," Pelosi said in a statement. "Democrats will stand fast against the immoral, ineffective border wall and the rest of Republicans' unacceptable poison pill riders."

Some Republicans would also be likely to bristle at the inclusion of the wall in a government funding bill. Even members of the Trump administration are skeptical about such a fight, according to Politico. The report said many wanted Trump to stop talking about the wall and focus on the upcoming battle over tax reform.

"You have barely anyone here saying, 'Wall, wall, we have to get the wall at all costs,'" one White House official told Politico.

Isaac Boltansky, a political analyst at the research firm Compass Point, said in a note to clients Wednesday that Trump's fiery rhetoric on the wall increased the chance of a shutdown.

"President Trump's apparent commitment to securing funds for the border wall as part of this funding agreement dramatically raises the specter of a shutdown in October," he wrote.

Boltansky said, though, that Trump could secure some symbolic funding for the wall if he yielded to some Democratic priorities.

"I think we could ultimately see a deal where Democrats allow for some level of symbolic border-wall funding in exchange for a number of policy concessions," Boltansky said in an email. He added that what would be in a final package was unclear, but "it is fair to assume" that the Affordable Care Act's cost-sharing-reduction payments and the federal government's budget caps "will be central in the talks."

Trump has at times expressed a willingness to shut down the government. He said after a budget deal reached in May that the "country needs a good 'shutdown' in September." Other Trump administration officials, like Treasury Secretary Steven Mnuchin and the White House budget director, Mick Mulvaney, have also suggested a shutdown could be necessary.

The chaos of a shutdown would most likely come with consequences for Trump and Republicans.

For one thing, it would be historic. The last time the government shut down while one party controlled Congress and the White House was in 1979 under President Jimmy Carter. That shutdown, however, was mild, as no federal employees were furloughed.

And any uncertainty could negatively affect financial markets worried about government dysfunction.

"Democrats will not agree to any budget that funds a wall, and if Trump wants to shut down the government — good luck with that," said Greg Valliere, the chief global strategist at Horizon Investments. "He'll get the blame."