President Donald Trump said “bye-bye” and stormed out of negotiations Wednesday on funding a US-Mexico border wall when Democratic opponents refused to agree to the project.

“A total waste of time,” Trump tweeted about his White House meeting with top Democratic congressional leaders. “I said bye-bye, nothing else works!”

Chuck Schumer, the top Democrat in the Senate, told journalists Trump “sort of slammed the table,” then “got up and walked out.”

“Again, we saw a temper tantrum because he couldn’t get his way,” Schumer said.

Although the two sides agreed that the meeting ended abruptly, they argued over who was to blame.

According to supporters of Trump at the meeting, the president asked Democratic leaders whether they would agree to fund his wall project in exchange for him ending a painful shutdown of swaths of government, which he has instigated in retaliation for the standoff.

The Democratic speaker of the House of Representatives, Nancy Pelosi, “raised her hand and said no, not at all,” said Kevin McCarthy, the senior Republican in the House, who was also present.

“We heard once again that Democratic leaders are unwilling to even negotiate,” Vice President Mike Pence said.

The vice president insisted that Trump came in good faith.

“The president walked into the room and passed out candy,” Pence said. “I don’t recall him ever raising his voice or slamming his hand.”

Trump wants $5.7 billion to fund a wall he says is needed to keep out dangerous illegal immigrants, drug dealers and people smugglers from Mexico.

Democrats say the wall would have little impact on real border problems and that Trump’s tough approach has instead created a humanitarian crisis among vulnerable, unthreatening migrants.

Trump’s main lever to exert pressure on Congress has been to refuse signing spending bills that cover large areas of government. As a result, some 800 000 federal employees and many more contractors have now been without pay for almost three weeks.

Democrats insist they will not lift their opposition to the wall project and believe Americans will tire of the shutdown chaos and blame Trump.

But Trump indicated Wednesday on a visit to Republican allies in Congress that he will continue to play hardball.

“Whatever it takes,” he told journalists, when asked how long the shutdown could continue.

Earlier at the White House, Trump told journalists that if he cannot get his way, he could declare a national emergency, a measure that allows him to bypass Congress and take the wall funds he needs from the military.

“I think we might work a deal, and if we don’t, we might go that route,” he said, insisting he has the “absolute right” to declare an emergency, despite warnings in Congress that this could be seen as serious presidential overreach.

Trump’s triumphant 2016 campaign relied heavily on his “build the wall” slogan and since then, he has pushed the idea that the United States is being overwhelmed by dangerous migrants who enter the country illegally.