WASHINGTON — President Donald Trump and Democrats Chuck Schumer and Nancy Pelosi bickered at length on Tuesday in an explosive public meeting at the White House over the president's promised border wall and threat to shut down the government if Congress doesn't fund it.

"If we don't get what we want one way or the other ... I will shut down the government," Trump said during a highly unusual fight that played out in front of the press before the official meeting began. "I am proud to shut down the government for border security. ... I will take the mantle of shutting it down."

If Trump and Congress can't agree to a funding bill by Dec. 21, large parts of the federal government will run out of operating authority. The Defense Department, however, is funded through the end of next September.

Trump said it was unlikely that he would strike a deal Tuesday with Pelosi, a California Democrat who is expected to become House speaker next month, and Schumer, a New York Democrat who is the Senate minority leader.

"We may not have an agreement today," he said. "We probably won’t."

The House Freedom Caucus, a group of Trump's Republican allies in Congress, demanded Monday night that $5 billion be included for the wall in any spending bill, while the Democratic leaders have been open to accepting less than $2 billion.

Earlier in the day, according to two sources who spoke to NBC News on the condition of anonymity, Pelosi told House Democrats that she and Schumer would offer the president a deal to pass six appropriations bills and a yearlong extension of current funding for the Department of Homeland Security.

Short of that, she said, they would agree to a basic extension of funding through Sept. 30, 2019, for all seven appropriations bills, including the one that funds Homeland Security.

Before Trump took ownership of a possible shutdown, Pelosi took an early dig at him in her opening remarks and noted that his party still controls both the House and Senate until January.

"We must keep the government open," she said. "We cannot have a Trump shutdown."

"A what?" he snapped at her.

"You have the White House, you have the Senate, you have the House of Representatives," Pelosi responded.

But, she noted, not all Republicans are on board with his plans to build a physical barrier.

"There are no votes in the House, a majority of votes, for a wall," Pelosi said.

"If I needed the votes for the wall in the House, I would have them in one session," Trump countered. "It would be done."

But for two years, he has been unable to muster those votes for his core campaign promise during the 2016 election — a wall along the U.S.-Mexico border that Trump vowed Mexico would pay for.

Vice President Mike Pence watched Tuesday's spectacle unfold in silence as Trump and the Democrats also fought over the results of last month's midterm elections and their meaning.

Outgoing White House chief of staff John Kelly and presidential advisers Ivanka Trump, Jared Kushner and Stephen Miller were also in the room for the meeting.

Pelosi urged the president to stop bickering in front of the media.

"This is spiraling downward," she said.

The private portion of the discussion was brief, as Pelosi and Schumer emerged quickly to talk to reporters outside the White House.

Schumer said Trump threw a "temper tantrum."

Later, back at the Capitol, he said the meeting was "productive" in that "the president showed what he wanted: shutdown."

Sen. Lindsey Graham, R-S.C., a top Trump ally, cheered the president on from the sidelines of Twitter.

"Great job sticking to your guns on border security, Mr. President!" he wrote. "You are right to want more border security funding including Wall money. They are WRONG to say no."

Graham also advocated for Trump to add into the mix a provision protecting certain undocumented immigrants who were brought to the country as children from deportation to put pressure on Democrats to approve money for the wall.

Likewise, some Democrats took to social media to back their leaders.

"Remember when Mexico was going to pay for the President's wall?" Rep. Val Demings of Florida tweeted. "Shutting down the government over this foolish idea would be wildly irresponsible. A shutdown would cripple the economy and degrade transportation security during the holidays."