On Wednesday morning, President Donald Trump sat down with House and Senate leaders from both parties and struck a deal to tackle Congress’s month from hell.

That deal ended up being just what Democrats wanted, and has reportedly left Republicans howling with protest. “I am told by multiple sources [that Republican leaders] are furious,” Politico’s Jake Sherman tweeted. “All GOP leaders were opposed.”

According to the deal, the top three items on Congress’s agenda — hurricane aid money, increasing the debt ceiling, and funding the government — will all be approved as part of a bipartisan agreement.

That’s good for everyone, since these were all must-pass measures, and Congress’s failure to act on any of the three this month would have been disastrous.

But the reason Democrats are so happy lies in the details and, specifically, the calendar. That is: The debt ceiling increase and government funding money will only last three months, until mid-December.

This is exactly what Senate Minority Leader Chuck Schumer and House Minority Leader Nancy Pelosi wanted — in fact, they publicly proposed it before the meeting. And it’s exactly what House Speaker Paul Ryan and Senate Majority Leader Mitch McConnell feared, and are said to have argued against in the meeting with Trump.

In fact, on Wednesday morning Ryan called the idea of a three-month debt limit increase “ridiculous,” “disgraceful,” and “unworkable” — just hours before Trump agreed to it.

Why Republicans in Congress so dislike this deal

McConnell and Ryan so disliked the idea because, rather than getting the time-consuming debt ceiling and government funding issues off Congress’s plate for some time, it ensures those issues will just come back and have to be dealt with again in December.

This would have several consequences that are expected to help Democrats and hurt Republicans.

The critical background here is that the Republican Party hates dealing with the debt ceiling. GOP leaders know that the debt ceiling must be increased, or else a US debt default with damaging economic consequences would ensue.

But conservative activists have spent years agitating against a “clean” debt limit hike without accompanying spending cuts. And many Republican lawmakers who have portrayed themselves as tough on spending fear being criticized from the right for supporting such a measure.

Because the issue so divides the GOP, Republicans can’t come close to passing a debt ceiling increase with just their own party’s votes — they need a lot of Democrats, and that means they need to strike a deal with Democratic leaders.

All this ugliness is why Ryan and McConnell wanted a debt ceiling increase that would last through the 2018 elections. They wanted the debt ceiling issue off their plates so they could move on to other issues, like tax reform, which they hoped to pass by the end of the year.

Instead, though, this deal all but ensures the December legislative calendar will be dominated by a painful showdown over the debt ceiling and government funding.

Then there’s the matter of Trump’s border wall money. For months, the president has been signaling that he’d demand money for his wall be included in any government funding bill. He’s even suggested he’d be happy to risk a government shutdown to get his wall money. But what Trump is clearly not willing to risk is a default on the nation’s debt — he doesn’t want to play that game of chicken.

In agreeing to this deal, Trump is putting aside his demand for border wall money for the time being, perhaps hoping to revisit the issue in December. The problem that the debt ceiling matter will be lurking unresolved too at that same time, ready for Democrats to bring up again as a part of another big deal. Basically, it won’t get any easier for Trump to get his wall money by December.

Finally, Democrats feel that this deal will pave the way for a vote to protect DREAMers sometime in the next few months — a vote President Trump said today that he wants. “Congress, I really believe, wants to take care of this situation,” he told reporters on Air Force One. “Chuck and Nancy would like to see something happen, and so do I.”

None of this, of course, is set in stone until it actually passes Congress. But while this deal is hardly a victory that affirmatively advances liberal priorities, Democrats do see it as a tactical win that will help strengthen their party’s hand in the coming months.