A few months ago, at the height of the health care debate, it was an open secret that Republicans were terrified of the prospect of Donald Trump negotiating directly with Democratic leaders. The fear, of course, was that the amateur president would sit down Nancy Pelosi and Chuck Schumer, he’d find their pitch compelling; and Trump would end up giving Dems everything they asked for.

All of this came to mind yesterday, when the president hosted an Oval Office meeting with congressional leaders on some of the fiscal issues pending on Capitol Hill. Democrats had already called for a three-month extension on the debt ceiling, pushing the issue off until December. House Speaker Paul Ryan (R-Wis.), about an hour before the White House gathering, described this approach “ridiculous,” “disgraceful,” and “unworkable.” Treasury Secretary Steve Mnuchin hated it, too.

And yet, Donald Trump, without a whole lot of debate, endorsed it anyway.

Steven Mnuchin, seated on a couch to the president’s right, had pushed this point before: A longer-term extension of 18 months would extend the deadline past the midterms – which would take partisan politics out of the debate, in his view. But Senate Minority Leader Chuck Schumer, D-N.Y., disagreed: He wanted something much shorter. The president, in deal-making mode, had heard enough. As Mnuchin made his case, Trump cut in: He would side with Schumer, House Minority Leader Nancy Pelosi and the Democrats to make a 90-day deal to lift the debt ceiling.

The result was a bipartisan package deal that gave Democrats exactly what they wanted: disaster-relief funding for Hurricane Harvey victims, a three-month extension on the debt ceiling, and a three-month spending bill that keeps the government’s lights on until December.

I’ve seen some reports that Trump helped broker the “deal” yesterday, but Slate’s Jim Newell raised an excellent point: “It’s not even a ‘deal’ in the sense of give-and-take between two sides. It is, to the letter, the request that Democrats had made and that Ryan and the leadership team had decried as an affront to God immediately after.”

I’m not sure who was more surprised yesterday afternoon: Republicans, who thought Trump would defend the GOP line with vigor, or Democrats, who didn’t expect to prevail so easily.

As for why, exactly, Trump gave Schumer and Pelosi what they wanted in exchange for nothing, theories abound. Maybe the meeting lasted more than a few minutes and the restless president saw this as a way of wrapping up the meeting. Perhaps Trump was confused and thought a three-month extension was the conservative line. Maybe he thought a bipartisan agreement would be a popular move that would help clear the way for future legislative progress.

Perhaps the president is the world’s worst negotiator.

There’s also the possibility, of course, that Trump is feeling increasingly hostile towards Congress’ Republican leadership, which has been the target of some recent presidential rebukes. By ignoring the GOP’s opposition to the Democratic request, this could’ve been some kind of power-play in which Trump was trying to assert his dominance over his ostensible allies.

Whatever the motivation, Dems find themselves in the position they wanted. Congress will now hold two politically difficult debt-ceiling votes this calendar year, and given the number of far-right Republicans who disapprove of raising the debt limit, Democrats expect to have considerable leverage in three months, when GOP leaders will be eager to avoid a shutdown and a default that would destroy the economy.

What’s more, all of this will take up quite a bit of the legislative calendar in the coming months, which also plays to Dems’ benefit – because the more Congress has to take time focusing on these measures, the less time Congress has for other far-right priorities.

There’s a reason the far-right isn’t pleased this morning.

Postscript: It’s worth emphasizing that the Trump-endorsed deal still needs to be approved by the House and Senate, which, the last time I checked, still have Republican majorities. The conventional wisdom is that this package will pass, but given the scope of GOP grumbling yesterday, it’s by no means a given.

And if the Republican Congress rejects the Republican president’s plan, things will get even more interesting.