President Trump pauses during a meeting with, from left, Senate Majority Leader Mitch McConnell (R-Ky.) Senate Minority Leader Chuck Schumer (D-N.Y.), House Minority Leader Nancy Pelosi (D-Calif.) and other congressional leaders in the Oval Office. (Evan Vucci/AP)

Political tremors seized both major parties on Thursday in the wake of President Trump’s sudden alignment with congressional Democrats, leaving Republicans alarmed about the unraveling of their relationship with the White House and uncertain about the prospects for their policy ambitions this fall.

In the span of 48 hours, Trump cut a deal with Democrats to keep the government funded and raise the nation’s borrowing authority, advanced talks with the senior Senate Democrat on a permanent debt ceiling solution and followed the advice of the top House Democrat, who urged him to use Twitter to ease the fears of young undocumented immigrants.

The developments confounded congressional Republicans and Democrats at the Capitol, where some long-standing political norms seemed to many to be shattered. The upheaval also raised new questions about how Trump plans to approach the looming debates over tax reform, immigration, government funding and the nation’s debt — and where congressional Republicans fit in.

“Haven’t seen anything like it before,” said Sen. John McCain (R-Ariz.), who has served in the Senate for three decades. Of Trump, McCain said: “I have no way of divining his motives. I’m a pretty intelligent guy, but I don’t understand this.”

Democrats proceeded carefully amid the escalating GOP tensions, framing Trump’s overtures as an opening to assert themselves more forcefully while acknowledging that Trump’s favor could be fleeting — and that their many intractable differences are likely to remain.

President Trump’s decision to back Democrats’ plans for raising the debt ceiling and permanently removing Congress’s debt ceiling requirement is frustrating Republicans, and especially conservatives. (Jenny Starrs/The Washington Post)

“There aren’t permanent alliances. There aren’t governing philosophies. There’s day by day, seat-of-the-pants management,” Sen. Chris Murphy (D-Conn.) said in an interview.

By that measure, the Democrats have enjoyed two good days working with Trump.

On Wednesday, the president agreed to support legislation providing hurricane relief money in a package that also averts an imminent shutdown of the federal government and raises its borrowing limit for three months. The deal gives Democrats leverage to play a role in negotiations over several big-ticket items at the end of the year, including efforts to pass a law allowing undocumented immigrants brought to this country as children to remain here legally.

And on Thursday, Trump talked up the possibility of permanently removing the requirement that Congress repeatedly raise the nation’s borrowing limit. It was an idea he had discussed with Senate Minority Leader Charles E. Schumer (D-N.Y.) a day earlier, according to three people familiar with the discussion. The idea is opposed by many Republicans, including House Speaker Paul D. Ryan (R-Wis.), who see the imposition of a debt limit as a check on government spending.

Also Thursday, Trump tweeted that young undocumented immigrants currently protected by an Obama-era executive order known as Deferred Action for Childhood Arrivals do not need to worry about his administration acting against them for the next six months. The tweet followed the White House’s announcement this week that the program will be rescinded in six months.

It followed a request from House Minority Leader Nancy Pelosi (D-Calif.) — and was a striking move from Trump, who has largely ignored counsel of his own party’s leaders when it comes to his controversial social media habits, and who has rarely if ever communicated with Democrats about messaging.

“For all of those (DACA) that are concerned about your status during the 6 month period, you…