It fell to John F. Kelly, his chief of staff, who is also a newcomer to high-stakes legislative talks, and is still learning to channel Mr. Trump’s fluctuating impulses, to haggle over the details with Republican leaders, who have become accustomed to plunging into tricky negotiations without a clear sense of what the president would accept.
Mr. Trump shuttled between the presidential residence and the Oval Office, where he spent some time in the afternoon. Throughout the day, he monitored television coverage that toggled between the government shutdown and the women’s marches, one of which ended near the White House.
The president spoke with the Homeland Security secretary, Kirstjen Nielsen, and Jim Mattis, the defense secretary, to discuss the impact of the shutdown on border security and the military. He spoke by phone with Senator Mitch McConnell, Republican of Kentucky and the majority leader, the House speaker, Paul D. Ryan, Republican of Wisconsin, and the House majority leader, Kevin McCarthy of California, to strategize on a path forward.
The immediate cause of the shutdown, which began at 12:01 a.m. Saturday after Senate Democrats blocked consideration of a House-passed stopgap measure, was a dispute over spending. But it was a stalemate over immigration policy, the topic that propelled Mr. Trump’s political rise and has dominated his first 12 months as president, that snarled the negotiations, as the president vacillated over what approach he should take and advisers including Mr. Kelly counseled a harder line.
Eager to strike a deal with Democrats to extend deportation reprieves to a group of undocumented immigrants brought to the country as children, Mr. Trump was nonetheless constrained by his own campaign promises to toughen immigration restrictions, and hemmed in by Republican congressional leaders uneasy about lining up behind a mercurial president with a penchant for changing his mind.
As negotiators on Capitol Hill held out hope of a swift agreement that could end the impasse before the weekend was out, the House and the Senate reconvened for a rare Saturday session. The likeliest path to reopening the government is an agreement on a stopgap spending measure that would stretch longer than the few days that Senate Democrats wanted, but shorter than the four weeks that the House approved on Thursday night.
Sarah Huckabee Sanders, the White House press secretary, said on Saturday that the president refused to negotiate on immigration issues until there was a deal to reopen the government.
Referring to Democrats’ insistence that a deal to protect the young immigrants be in hand before they agree to a funding measure, Marc Short, the White House legislative director, told reporters at the White House: “There is nothing in this bill Democrats say they object to, yet it’s like a 2-year-old temper tantrum to say, ‘I’m going to take my toys and go home because I’m upset about something else.’”
In his morning Twitter burst, Mr. Trump said Democrats were prioritizing “illegal immigrants” over American citizens and military personnel, and argued that the only solution to end the dysfunction was to defeat the party in this year’s midterm congressional elections.
“Democrats are far more concerned with Illegal Immigrants than they are with our great Military or Safety at our dangerous Southern Border,” the president said on Twitter. “They could have easily made a deal but decided to play Shutdown politics instead. #WeNeedMoreRepublicansIn18 in order to power through mess!”
In fact, it was Mr. Trump who opted not to pursue a potential deal that he and Senator Chuck Schumer of New York, the top Senate Democrat, had hashed out over lunch at the White House on Friday. The proposal would have kept the government open, funded a border wall and extended legal status to undocumented immigrants brought to the United States as children, while including disaster aid funds and money for a federal children’s health insurance program. Mr. Kelly later called Mr. Schumer to say the agreement lacked sufficient immigration restrictions.
While Mr. Schumer said shortly after the government shut down that “in my heart, I thought we might have a deal tonight,” White House officials argued that he had drastically overstated the progress made during the lunch.
On Saturday, though, Mr. Schumer said that even members of the president’s party had by now recognized that Mr. Trump was ill equipped to strike a political compromise.
“What’s even more frustrating than President Trump’s intransigence is the way he seems amenable to these compromises before completely switching positions and backing off,” he said on the Senate floor. “Negotiating with President Trump is like negotiating with Jell-O.”
The remark echoed one made by Senator Lindsey Graham, Republican of South Carolina, at a hearing this past week, in which he said there were “two Trumps,” one who was open to a bipartisan immigration deal and one who was not.
Mr. Trump’s shifting desires and demands on immigration have complicated the task of resolving the shutdown conflict. He has repeatedly signaled an inclination to strike a deal with Democrats that would codify Deferred Action for Childhood Arrivals, or DACA, the Obama-era program that gave work permits and deportation reprieves to about 800,000 undocumented immigrants brought to the United States as children.
But each time he has drifted toward such a bargain — first at a dinner last year with Mr. Schumer and Representative Nancy Pelosi of California, the minority leader, then at a large meeting in the Cabinet Room this month with lawmakers in both parties, next in phone conversations with Mr. Graham and Senator Richard J. Durbin, Democrat of Illinois, and again on Friday with Mr. Schumer — he has snapped back to a hard-line position.
Conservative Republican lawmakers and proponents of immigration restrictions in his inner circle at the White House, led by his senior adviser, Stephen Miller, and Mr. Kelly, have often been the ones to intervene, pushing the president to take a harder line.
One senior administration official, who asked for anonymity to discuss private conversations, described an inexperienced president who genuinely wanted to reach a deal with Mr. Schumer when he called the Democratic leader to the White House on Friday. But Mr. Trump had not determined how it would play out or mapped out a strategy with Republican leaders, the official said, or considered how the politics of a shutdown might unravel.
After Mr. Schumer departed, Mr. Trump met at the White House with Representatives Mark Meadows of North Carolina and Raúl Labrador of Idaho, members of the conservative Freedom Caucus who insist that any DACA measure include steeper immigration restrictions than the president has demanded.
Yet Mr. Trump has complained privately about his own advisers’ attempts to stiffen his spine on immigration. In the Cabinet Room meeting this month, the president erupted when an aide distributed a list of conditions that included restrictive interior enforcement measures. “I don’t know what this is,” the president said, according to a person briefed on the exchange, which was first reported by The Washington Post, and said he did not appreciate being blindsided by his own staff.
A Trump adviser painted a different picture, saying that Mr. Durbin, the second-ranking Democrat, had expressed anger at the document, and that Mr. Trump, who often plays to the crowd in front of him, was merely joining in the outrage.
On Saturday, the president was left alternately defiant and angry, self-pitying and frustrated. He argued to aides that he did not deserve the blame he was taking, but without a credible deal on the table, there was little for him to do. Irritated to have missed his big event in Florida, Mr. Trump spent much of his day watching old TV clips of him berating President Barack Obama for a lack of leadership during the 2013 government shutdown, a White House aide said, seeming content to sit back and watch the show.
An earlier version of this article mischaracterized an interaction between President Trump and Senator Mitch McConnell. They spoke by phone, not in a White House meeting.