President Donald Trump met with Republican and Democratic congressional leaders on Friday to discuss the ongoing government shutdown.

Senate Minority Leader Chuck Schumer told reporters afterward that Trump threatened to keep the government shut down for "months or even years."

Newly elected House Speaker Nancy Pelosi also said the meeting was "contentious."

Senate Minority Leader Chuck Schumer told reporters Friday that President Donald Trump threatened to keep the federal government partially shut down for "months or even years," unless Democrats relent to the president's demands for US-Mexico border-wall funding.

Speaking after a roughly two-hour meeting with Trump at the White House, Schumer said Democrats urged Trump to agree to a short-term funding extension that would reopen the government and allow the leaders to continue discussions over border security without leaving 800,000 federal workers in limbo.

"We told the president we needed the government open. He resisted," Schumer said. "In fact he said he would keep it closed for a very long period of time — months or even years."

House Speaker Nancy Pelosi, who took over the House's top job on Thursday, also called the meeting "sometimes contentious."

"But we recognize on the Democratic side that we really cannot resolve this until we open up government," Pelosi said. "We made that very clear to the president. Services are being withheld from the American people, and paychecks are being withheld from people who serve the needs of the American people. And our border security will suffer if we do not resolve this issue."

Read more: The government shutdown is in its 14th day and there's no end in sight. Here's how Trump and Congress got into this mess.

Trump spoke subsequently in the White House Rose Garden, sounding more upbeat about the meeting than Democrats.

"I thought it was really a very, very good meeting. We're all on the same path in terms of wanting to get government open," Trump said. "We're going to be meeting — I've designated a group, and we're going to be meeting over the weekend, that group, to determine what we're going to do about the border."

Trump also confirmed that he threatened a shutdown of "months or years" and rejected Pelosi and Schumer's calls to reopen the government before discussing border security.

"We won't be opening until it is solved," the president said.

At the same time, the president also reiterated his demands for a border wall, which Pelosi and Schumer have categorically rejected.

House Democrats passed two bills on Friday that would reopen the government and extend funding into February for the agencies that are closed. Pelosi and the Democratic leadership said the measures would give the two sides time to come to an agreement.

The Senate passed nearly identical bills before the Christmas break, but they were blocked by the then Republican House majority after Trump flip-flopped on his support for the extension because of blowback from conservative TV pundits and hardline lawmakers.

With no solution reached, the government entered a partial shutdown on December 22.

The shutdown has since been a political staring contest with both sides digging in on their positions and playing the blame game. Prior to the shutdown, Trump seemed happy to take ownership of the shutdown.

"So I will take the mantle. I will be the one to shut it down," Trump said. "I'm not going to blame you for it — the last time you shut it down, it didn't work. I will take the mantle of shutting it down."

Read more: Trump says 'Democrats now own the shutdown' just 10 days after declaring he was 'proud to shut down the government'

The shutdown is now in its 14th day, and, with no resolution in sight, there is a good chance the funding lapse will be the longest in modern history.

The shutdown does not close the entire government, as Congress passed five of the 12 bills that fund various departments of the government. But many departments are still closed, including the departments of Agriculture, Commerce, Justice, Homeland Security, the Interior, State, Transportation, and Housing and Urban Development.

Employees in those departments will go without pay for the duration of the shutdown, with a total of 800,000 federal employees affected.

Of those workers, 420,000 are deemed essential, such as Coast Guard members and airport security, and are being forced to work with no pay. The other 380,000 employees are on furlough, meaning they do not receive pay and are not allowed to come in to work.