President Trump on Tuesday engaged in an extraordinary argument with Democratic congressional leaders over government funding, threatening a partial shutdown if his demands for border wall money are not met.

"I am proud to shut down the government for border security," Trump told House Minority Leader Nancy Pelosi (D-Calif.) and Senate Minority Leader Charles Schumer (D-N.Y.) during a contentious, 17-minute exchange inside the Oval Office.

"I will take the mantle," the president added. "I will be the one to shut it down, I'm not going to blame you for it."

Trump's vehemence left Pelosi and Schumer exasperated, with both leaders pleading with the president not to debate the funding request in front of the news media.

"Unfortunately, this has spiraled downward," Pelosi said, after arguing with the president over the need for a border wall and whether Republicans have the votes to pass wall funding through the House.

"It's not bad, Nancy. It's called transparency," Trump shot back after one objection from Pelosi, who appeared to anger the president when she accused him of wanting a "Trump shutdown" over the wall.

"I think the American people recognize that we must keep government open, that a shutdown is not worth anything and that we should not have a Trump shutdown," the Democratic leader said in her opening remarks.

"A what? Did you say 'Trump?'" the president responded, before whispering in Schumer's direction that he had been planning to call it a "Pelosi shutdown."

Vice President Mike Pence was seated next to Trump during the meeting, but did not speak.

The combative exchanged raised fresh doubts about whether Trump and Congress can avert a partial government shutdown by the Dec. 21 funding deadline, as both sides appeared unwilling to give ground on their border-security positions.

Tuesday also marked the first time Trump huddled with Schumer and Pelosi since the midterm elections. The spat provided a glimpse of what divided government could be like for the president when Democrats take control of the House next year.

Trump sought to heighten the drama surrounding the funding dispute. The meeting was scheduled to be closed to the press but the White House unexpectedly opened it to reporters just as Pelosi and Schumer were arriving at the White House.

After the meeting concluded, Schumer said Trump will shoulder all the blame if the government does shut down.

"The bottom line is simple. The president made it clear he wants a shutdown," he told reporters outside the West Wing, accusing Trump of throwing a "temper tantrum" in an effort to secure wall funding.

Trump began the day by making his case on Twitter why a wall is needed while dialing back his demand for full funding suggesting the military could build parts of it.

Democrats said Trump does not have the legal authority to use the military to build the border wall.

"To the extent that he could do so at all, it would be reckless and irresponsible to waste national security resources on a border wall that is nothing more than in-kind contribution to his re-election campaign," said Rep. Nita Lowey (D-N.Y.), who is expected to claim the gavel of the House Appropriations Committee next year.

Senate Democrats have noted that earlier this year, Defense Secretary James Mattis testified he did not have the authority to provide funds for a wall.

Despite Trump's shifting rhetoric, the battle lines in Congress have been drawn for quite some time when it comes to the wall.

Democrats are offering $1.3 billion for border fencing and barriers, short of Trump's $5 billion request. The money would be included in funding legislation for the Department of Homeland Security, one of seven remaining appropriations bills Congress must pass before funding lapses later this month.

Schumer said Trump was offered two options to avoid a shutdown: a one-year extension of Homeland Security funding at current levels while passing the other six bills or passing a one-year extension for all funding covered by the seven bills.

"It's his choice to accept one of those options or shut the government down," Schumer and Pelosi said in a terse statement following the meeting.

Trump for months has threatened a shutdown over his demand for more money for a wall along the U.S. southern border, something he first promised during the 2016 election.

But the president has struggled to secure that funding. While Republicans have had control of the House, Trump needs Democratic support to get the 60 votes in the Senate he needs to pass legislation to fund the wall.

-Niv Elis and Alexander Bolton contributed reporting. Updated at 2:02 p.m.