WASHINGTON — By the time President Trump woke up on Thursday morning, he was feeling upbeat. And as he watched television news reports about his fiscal agreement with Democrats, he felt like telling someone.

He picked up the phone and called the two Democratic congressional leaders, Senator Chuck Schumer of New York and Representative Nancy Pelosi of California. “The press has been incredible,” he gushed to Ms. Pelosi, according to someone briefed on their call. He was equally effusive with Mr. Schumer, boasting that even Fox News was positive.

A few hours later, Mr. Trump went on TV himself, vowing to turn a one-time spending-and-debt deal brokered out of expediency into a more enduring bipartisan alliance that could transform his presidency. He signaled openness to a Democratic proposal to eliminate the perennial showdowns over the debt ceiling, and he repeated his desire to cut a deal to protect younger illegal immigrants from deportation.

But even as Republicans fumed at being sidelined, many in Washington were skeptical that the moment of comity would last. Although Mr. Trump has at times preached bipartisanship, he has never made it a central part of his governing strategy. While he may have been feeling energized on Thursday by the collaboration, he is a politician driven by the latest expression of approval, given to abrupt shifts in approach and tone. He is a man of the moment, and the moment often does not last.

There are also reasons to doubt whether Democrats would sustain a partnership with Mr. Trump beyond the deal they have cut to keep the government open for three months and paying its debts. The centrifugal forces of partisanship tug from the left as well as the right, and the liberal base has put pressure on Democratic lawmakers not to meet in the middle a president it loathes.

For one day, though, the two sides sought to put months of acrimony behind them. “I think we will have a different relationship than we’ve been watching over the last number of years. I hope so,” Mr. Trump told reporters at the White House. “I think that’s a great thing for our country. And I think that’s what the people of the United States want to see. They want to see some dialogue. They want to see coming together to an extent.”

Image

One area of possible agreement could be a proposal advanced by Senator Chuck Schumer, the Democratic leader, to eliminate the requirement that Congress vote from time to time to raise the debt ceiling altogether, a perennial point of division in Washington.CreditPete Marovich for The New York Times

Democrats expressed a blend of optimism and caution. “We’ll see,” Mr. Schumer said in an interview. “I think it would be much better for the country and much better for Donald Trump if he was much more in the middle and bipartisan rather than siding with the hard right. I think he got a taste of it yesterday. We’ll see if it continues. I hope it does.”

One area of possible agreement could be a proposal advanced by Mr. Schumer to eliminate the requirement that Congress vote from time to time to raise the debt ceiling, a perennial point of division in Washington, and raise it automatically. “It could be discussed,” Mr. Trump said. “There are a lot of good reasons to do that.”

In a separate interview, Ms. Pelosi said that during their phone call, the president seemed eager to support legislation called the Dream Act preserving President Barack Obama’s program allowing 800,000 immigrants who were brought to the county illegally as minors to stay and work. Mr. Trump canceled the program this week on the grounds that Mr. Obama overstepped his authority, but he called on Congress to authorize it before it phases out in six months.

“He said, ‘I want to sign it. Let’s do it fast. Let’s do it soon,’” Ms. Pelosi said. “And I said, ‘All the better. We don’t want to take six months, and we don’t even want to take three months.’”

She used the opportunity to ask Mr. Trump to post a message on Twitter reassuring those in the program, called Deferred Action for Childhood Arrivals, or DACA, not to worry about deportation during the six-month wind-down period. “My members had said to me last night, ‘We need more assurance that people are going to leave these dreamers alone,’” she said.

She said she also asked Mr. Trump to make certain that the Department of Homeland Security did not target the young immigrants. “He said, ‘Are they doing that?” she said. “I said, ‘That is what is being reported to me, and I want to make sure that they don’t.’”

Image

“The press has been incredible,” Mr. Trump told Representative Nancy Pelosi, the House Democratic leader, about the consensus.CreditJoshua Roberts/Reuters

Whether this latest round of interaction marks a turning point in Washington, Ms. Pelosi sounded dubious. “Every day is a new day around here,” she said.

Still, Mr. Trump followed through on the Twitter promise. “For all of those (DACA) that are concerned about your status during the 6 month period, you have nothing to worry about — No action!” the president wrote shortly after the phone call.

The message appeared just as Ms. Pelosi was briefing her whips about the call. Representative Debbie Dingell of Michigan spotted the tweet on her iPad and read it out loud to surprised Democrats.

As Mr. Trump reached out to Democrats, he sought to keep the lines of communication open with Republican leaders. He called Speaker Paul D. Ryan of Wisconsin and Senator Mitch McConnell of Kentucky, the majority leader, and planned to host the House speaker for dinner on Thursday night.

But on Capitol Hill, Republicans were stirred up, convinced that Mr. Trump had effectively given Democrats the leverage to use the newly negotiated December deadline for government spending and the debt ceiling to win concessions.

“Chuck Schumer and Nancy Pelosi now have most of the cards for when we get to December,” said Senator Ben Sasse, Republican of Nebraska. “This is an embarrassing moment for a Republican-controlled Congress and a Republican administration.”

In the House, conservatives sounded more irritated with their own leadership than the president. At a breakfast for reporters on Thursday hosted by Bloomberg News, Representative Mark Meadows, Republican of North Carolina and the chairman of the conservative Freedom Caucus, implicitly criticized Mr. Ryan — though not by name — for failing to put forward “a conservative solution” to raising the debt limit, like linking it to spending cuts.

“Everybody’s surprised,” Mr. Meadows said. But, he added, “if there’s not a conservative solution out there for raising the debt ceiling, why should we be surprised?”

The rapprochement between Mr. Trump and Mr. Schumer brought back together two New Yorkers who have been at odds this year, but have known each other for a long time. Mr. Trump once held a fund-raiser for Mr. Schumer at Mar-a-Lago, the president’s Florida retreat. But Wednesday’s meeting was the first time the two had seen each other since shortly after Mr. Trump’s inauguration.

On Thursday, they saw each other again, when Mr. Schumer went to the White House to talk about an issue of local interest to him: the Gateway Program, a rail expansion project that calls for two new tunnels to be built under the Hudson River.

Their relations have been harsh and combative. Mr. Trump has ridiculed Mr. Schumer on Twitter as “Cryin’ Chuck Schumer.” When Mr. Trump convened a cabinet meeting in June, Mr. Schumer released a parody video mocking all of the secretaries praising the president.

Mr. Schumer said in the interview that he was surprised that Mr. Trump sided with Democrats on their fiscal plan. Going forward, Mr. Schumer said he could envision a scenario in which Mr. Trump worked with Democrats, bypassing Republican conservatives, on other issues. But he said “the next big test” will be whether Mr. Trump takes a leadership role in helping to pass the Dream Act.

White House officials have insisted that any immigration legislation also include elements to strengthen enforcement, presumably including money for Mr. Trump’s proposed wall on the southern border with Mexico. Mr. Schumer said money for border security might be acceptable, but under no circumstances would Democrats support a wall.

“Democrats will not sacrifice our principles for agreement’s sake,” Mr. Schumer said. “But if he moves in our direction, we will work with him.”