Washington (CNN) President Donald Trump walked out of discussions to end a partial government shutdown, now in its third week, calling the talks with congressional Democrats "a total waste of time."

"Just left a meeting with Chuck and Nancy, a total waste of time. I asked what is going to happen in 30 days if I quickly open things up, are you going to approve Border Security which includes a Wall or Steel Barrier? Nancy said, NO. I said bye-bye, nothing else works!" Trump said.

Just left a meeting with Chuck and Nancy, a total waste of time. I asked what is going to happen in 30 days if I quickly open things up, are you going to approve Border Security which includes a Wall or Steel Barrier? Nancy said, NO. I said bye-bye, nothing else works!

Top congressional Democrats blasted Trump after the meeting Wednesday afternoon, accusing him of indifference to struggling federal workers and not trying to negotiate as the government shutdown drags on.

"Unfortunately, the President just got up and walked out," said Senate Minority Leader Chuck Schumer of New York. "He asked Speaker (Nancy) Pelosi, 'Will you agree to my wall?' She said no. And he just got up and said, 'Then we have nothing to discuss,' and he just walked out. Again, we saw a temper tantrum because he couldn't get his way, and he just walked out of the meeting."

Meeting sours after candy

Trump was in a chummy mood when he entered the Situation Room, according to a source familiar with how things unfolded. The President passed out candy to attendees -- Butterfinger and Baby Ruth bars as well as M&M's.

Trump told congressional leaders they would find a letter at each of their chairs -- a copy of the budget request the Office of Management and Budget had put together for congressional staff in Sunday's meeting that laid out the administration's shutdown priorities.

Then, with the letters stating their position in front of them, White House officials asked Democrats where their position stood.

Pelosi informed the President she was concerned about ports of entry, something which he agreed with. Trump said there was money allotted in the administration's priority list that beefed up the ports of entry. But Homeland Security Secretary Kirstjen Nielsen, also seated at the table, interjected to say that even if the ports of entry eliminated all drug smuggling, smugglers would find another way in, which is why the barrier structure is important, sparking the most heated exchange of the meeting between Pelosi and Trump.

Schumer jumped in to stress the importance of opening up the government and then negotiating on border security funding from there.

He at one point asked Trump, "Why won't you open the government and stop hurting people?"

Trump responded bluntly, "Because then you won't give me what I want."

A White House official disputes that the President replied with those words. The official claims that Trump answered, "I gotta get you to do the right thing."

Trump then asked Democrats whether, if he opened up the parts of the government that are shut down, Pelosi would be willing to build a barrier. She declined.

A source familiar with what happened inside the room said Trump ended the meeting by standing up and announcing "bye-bye" before turning and walking out.

After Trump left the room, Pelosi and Schumer got up to leave. Vice President Mike Pence then asked for a counteroffer from Democrats -- asking what they are willing to work on, so the White House would have a better idea to move forward. They didn't offer one, something that has frustrated White House officials since they first privately offered less than $5.6 billion the day after the government shut down.

Immigration proposal considered

Staring at a prolonged shutdown, Republican senators are privately planning to court Democratic senators on an immigration deal that would give Trump money for his border wall and include several measures long-sought by Democrats, according to sources familiar with the matter.

Following Trump's meeting, GOP senators privately gathered in Sen. Lindsey Graham's office Wednesday to discuss a way out of the logjam. The long-shot idea: propose an immigration deal that would include money for the wall along with several provisions that could entice Democrats. Those items include changes to help those who are a part of the Deferred Action Childhood Arrival program as well as immigrants from El Salvador and other countries impacted by the Temporary Protected Status program -- as well as modifications to H2B visas.

GOP senators pitched the idea to senior White House adviser Jared Kushner, who said if they came up with a proposal that got Trump his border wall money and could pass the Senate, the White House would be open to more discussions on the matter, the source said. He did not say Trump would endorse such a plan.

The GOP senators -- who include Graham of South Carolina, Susan Collins of Maine, Thom Tillis of North Carolina, Lamar Alexander of Tennessee, Rob Portman of Ohio and Lisa Murkowksi of Alaska -- discussed the plan in a hastily arranged meeting Wednesday, with several of them now planning to propose the idea to Democrats to see if there's a enough support to break the logjam.

Breakdown in talks leads to fiery rhetoric

A White House official says no other meeting with Pelosi has been scheduled at this time, and a national emergency declaration is still on the table.

The meeting at the White House came just hours before the House of Representatives was expected to vote on individual bills to help reopen the government . The bills aren't expected to go anywhere in the GOP-controlled Senate at this time but the maneuver is aimed at putting pressure on Republicans. Trump promised earlier Wednesday to veto that legislation if it reached his desk.

Pelosi, speaking alongside Schumer outside the White House, said Trump was "insensitive" to federal workers missing pay during the shutdown and alluded to Trump's own privileged upbringing.

"He thinks maybe they could just ask their father for money, but they can't," the California Democrat said.

She added, "If you don't understand financial insecurity then you would have a policy that takes pride in saying, 'I'm going to keep government shut down for months or years unless you totally agree to my position.' "

Sen. Dick Durbin of Illinois, the Senate's number two Democrat, said after the meeting that "it was pretty clear" Trump's heart was not in it.

"He said today, in the middle of this meeting, 'I don't know why I'm doing this. I didn't want to do this meeting. They told me I had to do this meeting,' " Durbin said.

Top Republicans spoke to the media after the Democratic statements and took issue with their characterization of the meeting, though they did not dispute that Trump left the meeting. Among them were Pence, House Minority Leader Kevin McCarthy of California, House Minority Whip Steve Scalise of Louisiana and Sen. John Thune of South Dakota.

Notably, Senate Majority Leader Mitch McConnell, a Kentucky Republican, did not appear alongside them.

Pence said Trump told the Democrats "goodbye" after Pelosi denied his request for a wall, and the vice president contended the move made clear that Trump would not end the shutdown without his border measures.

"What the President made clear today is he is going to stand firm to achieve his priorities to build a wall, a steel barrier on the southern border, add additional personnel, additional resources, additional reforms to stem the crisis that we face on our southern border," Pence said.

McCarthy said Trump had gone back and forth with Pelosi and Schumer, and then eventually asked Pelosi, " 'OK, Nancy, if we open the government up in 30 days, could we have border security?' "

"She raised her hand and said, 'No, not at all,' " McCarthy recalled. "The President calmly said, 'I guess you're still not wanting to deal with the problem.' "

Wednesday's meeting came a day after Trump delivered an Oval Office address standing by his demand for Congress to fund his border wall with Mexico and Democrats continued to refuse the request. With no apparent end in sight to the disagreement, the shutdown was due to enter its 20th day.

This story has been updated with additional developments Wednesday.