WASHINGTON — President Donald Trump was in the mood to celebrate after cutting a big deal with opposition Democrats.

Joshing with Northeastern officials in the Cabinet Room, Trump hailed New York Democrat Andrew Cuomo as “my governor” and traded banter with Senate Democratic leader Chuck Schumer, another fellow New Yorker.

“If you just dropped in from outer space, you wouldn’t know what the last eight months have been like,” said Rep. Peter King, R-N.Y., recalling the friendly exchanges between Trump and Schumer during the meeting with New York and New Jersey lawmakers.

That would be the same Schumer whom the president had previously slammed as a “clown” and “Cryin’ Chuck.”

And now?

“In some ways it’s almost like they were completing each other’s sentences,” King said.

On display at that chummy scene Thursday was the Trump who’s emerged in full this past week: Trump the independent.

A president who spent months catering to the Republican conservative wing now appears unbound by ideology and untethered by party allegiances.

It’s not a complete surprise to his fellow Republicans. They long have worried that Trump, a former Democrat, might shift with the political winds. But Trump’s overtures to Democrats have left Republicans in an awkward and perplexing position, undercut by their leader and unsure of what’s next.

“Our grass roots are very confused,” said Rep. Mark Meadows, R-N.C., head of the conservative House Freedom Caucus, on MSNBC Friday. Meadows said he viewed the deal as a “unique situation because of the devastation in Texas.”

Trump’s deal with Democrats to raise the U.S. borrowing limit and keep the government running for three month months — all in the name of speeding relief to hurricane victims — quickly passed Congress and gave him the opportunity to savor a victory after months of legislative setbacks.

He’s now talking about possible future deals with Democrats — doing away with votes on the raising the debt cap, and shielding from deportation young immigrants living in the United States illegally who came brought here as children.

“I think that’s what the people of the United States want to see,” Trump said. “They want to see some dialogue.”

It’s unclear how much of Trump’s turnabout is a deliberate strategy to create space for his tax overhaul this fall or simply a deal-maker’s gut decision, bargained during an Oval Office session that left his fellow Republicans gobsmacked.

Trump has been frustrated by GOP leaders and blames House Speaker Paul Ryan, R-Wis., and Senate Majority Leader Mitch McConnell, R-Ky., for his inability to score big triumphs in Congress. He’s appeared unconcerned about dismissing their opposition to the debt ceiling deal, focusing instead on the fact that the move has him rare kudos with some television commentators.

Trump sprinkled salt on the wound Friday by reminding GOP leaders via Twitter about their failed efforts to overhaul former President Barack Obama’s health law: “Republicans, sorry, but I’ve been hearing about Repeal & Replace for 7 years, didn’t happen!”

In venting about Republican congressional leaders, Trump may just be channeling his supporters. Trump, who essentially hijacked the party two years ago, has positioned himself as the voice of voters who feel alienated from Washington and disdain both parties.

“The Republicans in the Senate did not follow through on their commitment in working with the administration to repeal Obamacare. So what’s he going to do?” asked Tony Perkins, the president of the Family Research Council.

Perkins said he didn’t think Trump’s most loyal supporters would approve of extended dealings with Schumer and House Democratic leader Nancy Pelosi of California. But, he added, “They’re just as mad at the Republican leadership as they are the Democrats.”

Still, Trump’s startling agreement on the debt left Republicans wondering how far he’s willing to stray from party orthodoxy in pursuit of a deal.

Their frustrations spilled out during a closed-door meeting Friday with Treasury Secretary Steve Mnuchin and White House budget chief Mick Mulvaney, a former South Carolina congressman, who were sent to Capitol Hill to defend the deal. At one point Mnuchin, a former Goldman Sachs executive and Democratic donor, drew hisses when he asked House Republicans to “vote for the debt ceiling for me,” according to Rep. Mark Walker, R-N.C.

From the start of his presidency, Trump has repeatedly labeled Democrats as obstructionists, and few expect his budding alliance with Schumer and Pelosi to be long-lived. Trump is loathed by the Democratic base, many of whom talk more openly about impeachment than cooperation.

But there’s little doubt that Trump’s talk of “dealmaking” may occasionally open up possibilities for Democrats.

“I think the president, when it comes to making deals, is an enigma,” said Rep. Steve King, R-Iowa.

King said he will continue to work with Trump, but acknowledged that the past week had been a “little unsettling” and noted that “conservative allies have been leaving the West Wing at a fairly regular pace.”

One of the top aides King was referring to was Steve Bannon. The strategist was ousted in August but remains a vocal proponent of the president’s agenda.

Trump announced the deal with Democrats while Bannon was sitting for an interview with CBS News, but the Breitbart executive chairman saved his most pointed remarks for McConnell and Ryan, accusing them of trying to “nullify” the results of the 2016 election.

The headlines on the Breitbart website Friday reflected the anti-establishment wing’s distrust of some of Trump’s New York allies, as well as party leadership — but not of Trump himself.

Other Republicans are willing to give Trump a pass, for now. “Of course I view him as a Republican,” said Rep. Darrell Issa, R-Calif. He said that when Republicans can’t solve a problem by themselves, “then the president has that obligation to be that neutral arbitrator.”

Associated Press writers Laurie Kellman in Washington and David Klepper in Albany, New York, contributed to this report.