President Trump said Friday he could declare a national emergency and bypass Congress to build his long-promised border wall — and warned that the government shutdown could last for months or years.

“Absolutely, we can call a national emergency. I may do it. We can call a national emergency and build it very quickly,” he said during a briefing in the Rose Garden after a two-hour meeting with top Democrats about the government shutdown and border security.

He also said he could seize private property from people who own land on the border “under the military version” of eminent domain, the law that allows the government to seize private property for public or private development.

Trump also warned House Speaker Nancy Pelosi and Senate Minority leader Chuck Schumer that he wasn’t backing off his demand for more than $5 billion for the border wall.

The Democrats sounded glum after the meeting.

Pelosi described it as “contentious” at times, while Schumer said Trump warned parts of the government could stay shut for years.

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

Trump confirmed Schumer’s account, saying: “I did say that, absolutely I said that. I don’t think it will, but I am prepared.”

He also held out hope for a quick resolution.

“I hope it doesn’t go on even beyond a few more days. It really could open very quickly,” Trump added.

Asked if he would offer a safety net for workers who were losing their salaries and health insurance, the president replied that the border wall was the safety net — and insisted that federal workers support his shutdown.

“I’m very proud of doing what I’m doing,” he said of sticking to his guns to get funding for the border wall.

While the Dems said no progress was made during the meeting, Trump called it “productive” because the two sides agreed to assemble teams that would discuss the stalemate this weekend.

But he ruled out any compromise measures that would allow the government to remain open while negotiations continued over the wall.

Peolsi also dug in her heels, saying there would be no deal until the government reopened.

The president opined that steel would be a better choice than concrete for his long-promised wall — but that it had to be “see-through.”

“A see-through wall made out of steel is far stronger than a concrete wall,” he argued.