United States President Donald Trump on Friday said that he is prepared for a partial government shutdown to last for “months or even years” after his talks with Democratic leaders to resolve the impasse over a border wall funding failed, The Washington Post reported.

Trump said he could also declare a national emergency to build the wall along the border with Mexico without congressional approval, but would first try a “negotiated process”.

During a press conference at the White House’s Rose Garden, Trump while responding to a journalist’s question confirmed that he had threatened to keep federal agencies closed for years if necessary, BBC reported. “I did say that, absolutely I said that,” he said. “I don’t think it will but I am prepared. I’m very proud of doing what I’m doing. I don’t call it a shutdown, I call it doing what you have to do for the benefit and safety of our country.”

House of Representatives Speaker Nancy Pelosi said Friday’s meeting had been contentious. Senate Democratic leader Chuck Schumer said his party members had told Trump that government should be re-opened, but the president resisted.

The president had met leaders from both parties to the White House two days after a meeting on border security failed to resolve matters and a day after the House held by Democrats passed a legislation to reopen the government, The Guardian reported. The US Senate, which is controlled by the Republicans, has decided not to pass the House proposal.

Around 8 lakh federal workers have been been affected as the government shutdown entered its third week. The Trump administration has called for at least $5 billion for the wall, which Democrats have opposed.