WASHINGTON (Reuters) - President Donald Trump threatened to keep the U.S. government partially shut for months or years on Friday after he and Democratic leaders failed to resolve their dispute over Trump’s request for $5.6 billion to build a wall on the Mexican border.

After Democratic congressional leaders refused Trump’s requests at a meeting in the White House Situation Room, the Republican president threatened to take the controversial step of declaring a national emergency and building the wall without congressional approval.

Trump is withholding his support for a bill that would fully fund the government until he secures money for the wall. As a result, around 800,000 public workers have been unpaid, with about a quarter of the federal government closed for two weeks.

Senate Democratic Leader Chuck Schumer said Democrats had told Trump during the meeting to end the shutdown. “He resisted,” Schumer said. “In fact, he said he’d keep the government closed for a very long period of time, months or even years.”

Trump confirmed that comment but painted a more positive picture of the meeting, the first since a new era of divided government began when Democrats took control of the House of Representatives on Thursday.

“We had a very, very productive meeting, and we’ve come a long way,” Trump said.

According to a source familiar with the White House discussion, Trump opened the meeting with a speech that lasted at least 15 minutes in which he insisted on the need for billions of dollars to fund a border wall.

The source also said Trump brought up recent impeachment threats during those remarks, arguing that he had notched a strong performance as president and should not be a target for impeachment.

The president later told reporters that Nancy Pelosi, the new Democratic speaker of the House of Representatives, said Democrats were not looking to impeach him.

NATIONAL EMERGENCY?

Raising the stakes in his tussle with the newly emboldened Democrats, Trump threatened extraordinary measures to build the wall, which he says is needed to stem the flow of illegal immigrants and drugs into the United States.

A reporter asked Trump whether he had considered declaring a national emergency to build the wall.

“Yes, I have. And I can do it if I want,” Trump said. “We can call a national emergency because of the security of our country ... I may do it. But we can call a national emergency and build it very quickly. And it’s another way of doing it. But if we can do it through a negotiated process, we’re giving that a shot.”

Slideshow ( 17 images )

Emergency powers have been invoked by previous U.S. presidents during times of war.

Senator Jack Reed, the senior Democrat on the Senate Armed Services Committee, criticized the comments, saying in a statement, “Declaring a trumped up national emergency in order to skirt congressional approval is wrong.”

The U.S. Constitution assigns Congress the power to fund the federal government, so Trump likely would face legal challenges if he tried to bypass Congress on financing the wall. Building a wall - and having Mexico pay for it - was one of Trump’s main promises when he ran for president in 2016.

Slideshow ( 17 images )

Trump’s wall project is estimated to cost about $23 billion.

Democrats have called the wall immoral, ineffective and medieval.

Pelosi said Friday’s meeting with Trump was “sometimes contentious” but that they agreed to continue talking.

“But we recognize on the Democratic side that we really cannot resolve this until we open up government and we made that very clear to the president,” she said.

Credit rating agency Moody’s said the shutdown will cause minimal U.S. economic and credit market disruption but there could be a more severe impact on financial markets and the broad economy if the closure is protracted.

A Reuters/Ipsos opinion poll last week showed that 50 percent of the public blames Trump for the shutdown and 7 percent blames Republican lawmakers, while 32 percent blames Democrats.

In a Dec. 11 meeting with Pelosi and Schumer, Trump said he would be “proud” to shut the government over the security issue and would not blame Democrats. He has since said they are responsible.

White House officials and congressional staffers will meet at 11 a.m. EST (1600 GMT) on Saturday to try to end the impasse, White House spokesman Hogan Gidley said.

House Republican leader Kevin McCarthy told reporters that Trump had named Vice President Mike Pence, senior aide Jared Kushner and Secretary of Homeland Security Kirstjen Nielsen to work over the weekend.

The partial shutdown is straining the country’s immigration system, worsening backlogs in courts and complicating hiring for employers.

Federal agencies such as the Justice Department, Commerce Department and departments of Agriculture, Labor, Interior and Treasury have been hit by the shutdown.

House Ways and Means Committee chairman Richard Neal, a Democrat, asked the Internal Revenue Service in a letter on Friday to explain the possible effects of the shutdown on the upcoming tax filing season for millions of Americans.