WASHINGTON – President Donald Trump told Democrats Friday he is prepared to allow the partial government shutdown to go on months or even years if that's what it takes to get a border wall.

"I will do whatever I have to do," Trump said at a news conference after a budget meeting that he and Democratic lawmakers described as contentious.

Democrats emerged from the meeting say the president had threatened a long shutdown if they continued to reject his demand for a wall along the U.S.-Mexico border.

Trump acknowledged telling Democrats that the shutdown could last months or years. "Absolutely I said that," he told reporters. He also said he hoped the matter would be resolved soon after more negotiations over the weekend, although it was not clear whether he had offered Democrats any new proposals.

"I don’t think it will" last months, he said of the shutdown, "but I am prepared."

Trump also said he is considering declaring a "national emergency" over the border situation, and potentially order the construction of a border wall using money from the Pentagon budget..

"Absolutely ... we can do it," he said.

Democratic leaders said Trump refused to consider a plan to re-open the government now while negotiations continue.

"He resisted," said Senate Minority Leader Chuck Schumer, D-N.Y. "In fact, he said he’d keep the government closed for a very long period of time – months or even years.”

New House Speaker Nancy Pelosi, D-Calif., said Democrats "are committed to keeping our border safe," and "we can do that best when government is open."

Nevertheless, Trump insisted the meeting with Democrats was "productive" and said the parties agreed to create teams of negotiators who will meet over the weekend to discuss a deal to re-open the government and provide for border security, including a wall.

Democrats, meanwhile, downplayed the prospects of new talks. They said the term "working group" was not used during the meeting with Trump, and they expect staff-to-staff discussions to continue as they have been all along.

During his lengthy news conference, Trump also:

– Talked about using what he called "the military version of eminent domain" to seize private land for border wall construction. Conservative Republicans have long criticized the government's use of eminent domain, and backed high-profile lawsuits to restrict its use.

– Said he would consider asking Vice President Mike Pence and other executive branch officials to forgo planned pay raises while the shutdown is in place.

Trump maintained that he wants $5.6 billion for border security and wall funding, and dismissed proposed compromises ranging from $1.3 billion to $2.5 billion.

Pelosi and other Democrats, however, have remained adamant in their opposition to any federal money for a wall along the U.S.-Mexico border.

"A wall is an immorality between countries," Pelosi said Thursday after Democrats passed their own plan to reopen the government. "It's an old way of thinking. It isn't cost effective."

Said Pelosi: "We're not doing a wall."

Negotiations over the weekend will cover a shutdown resolution as well as way to address the "crisis" on the nation's southern border, Trump said.

That includes possibly addressing legal status for "Dreamers," the children of undocumented parents whose fate is uncertain after Trump ended the Deferred Action for Childhood Arrivals (DACA) program, the president said.

More:Democratic Nancy Pelosi takes gavel in House as period of divided government begins

An negotiations continue, Democratic lawmakers said they would continue to push legislation the new Democratic House passed late Thursday.

The legislation would fund all eight departments for the remainder of the fiscal year, which ends Sept. 30. It passed largely along party lines, with seven Republicans joining Democrats in supporting the bill.

Pelosi's plan would also fund the Department of Homeland Security at current spending levels through Feb. 8, giving the parties time to negotiate a longer-term budget.

The House Democratic legislation includes $1.3 billion for border security, but nothing for a wall – the reason Trump said he rejected it.

"We'll see what happens," Trump said of further negotiations on the shutdown. "It may get solved. It may not get solved."