US President Donald Trump has said he is prepared to keep the US government closed for a year or more, as he stood firm on his contentious demand for billions of dollars to fund a border wall with Mexico.

Mr Trump confirmed he said as much in a meeting earlier today with top Democrats that failed to produce a deal on ending the two-week shutdown.

"Absolutely I said that," Mr Trump said, adding. "I don't think it will. But I am prepared."

Mr Trump also said he may call a national emergency to build the wall quickly.

He added that he might consider asking cabinet members not to accept a scheduled pay rise while the government was partially shut.

Mr Trump described a meeting at the White House over the shutdown as productive but Nancy Pelosi, the newly elected speaker of the House of Representatives after the Democrats took control of the chamber on Thursday, said it was sometimes contentious.

"We told the president we needed the government open," Democratic Senate Leader Chuck Schumer told reporters after the meeting in the White House Situation Room.

"He resisted. In fact, he said he'd keep the government closed for a very long period of time, months or even years."

About 800,000 federal workers have been unpaid due to the closure of about a quarter of the federal government for the past two weeks as Mr Trump withholds his support for a bill that would fully fund the government until he secures the money for the wall.

Mr Trump says the wall is needed to stem the flow of illegal immigrants and drugs over the border.

When he ran for president in 2016, Mr Trump frequently promised to build the wall and vowed Mexico would pay for it, which it has refused to do.

Ms Pelosi said the two sides 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.

Democrats took over the House this week after gains in last November's congressional elections.

Hundreds of thousands of federal employees have either been furloughed or are working without pay because of the shutdown.

It is showing signs of straining the country's immigration system and has been blamed for worsening backlogs in courts and complicating hiring for employers.