Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

WASHINGTON — Republicans were left fuming at a deal struck Wednesday between President Donald Trump and Democratic leaders that combines disaster aid for Hurricane Harvey victims with measures to keep the government open and extend the debt ceiling for three more months.

The agreement occurred during a late-morning Oval Office meeting between Trump, Senate Majority Leader Mitch McConnell, House Speaker Paul Ryan, Senate Democratic Leader Chuck Schumer and House Democratic Leader Nancy Pelosi. During the meeting, Trump sided with the Democrats, agreeing to their demands for a short-term extension of government funding and the debt limit and rejecting Republicans’ efforts to seek a longer-term debt ceiling hike.

It was a blow to GOP plans to avoid a series of politically treacherous votes for their members, or at least provide cover for them by attaching it to the disaster relief bill.

By agreeing to the three-month extensions, the GOP-controlled Congress would be forced to revisit both the debt ceiling and government spending extensions in December. And it increases the pressure on Republicans to pass yet more extensions to both, or face the prospect of the U.S. defaulting on its bills or a government shutdown just weeks before Christmas.

Democrats praised the deal, which was reached just before the House overwhelmingly passed $7.85 billion in disaster relief with nothing else attached.

“It was a really good moment of some bipartisanship and getting things done,” Schumer told reporters.

But it leaves rank-and-file Republicans befuddled and with few good choices. Opposition to increasing the nation's debt ceiling has become a matter of principle for many conservatives who say that this deal is worse than any they could have imagined because it forces them to vote on it twice in three months.

“The Pelosi-Schumer-Trump deal is bad,” said Sen. Ben Sasse, R-Neb., in a short, terse statement.

McConnell told reporters it was the president’s decision and that GOP leadership will move forward with it.

“The President can speak for himself, but his feeling was that we needed to come together to not create a picture of divisiveness at a time of genuine national crisis and that was the rationale,” McConnell told reporters.

Still, it was a stunning turn of events.

Wednesday morning began with Pelosi and Schumer issuing their demand that the debt limit be increased for just three months as part of the hurricane relief bill. Ryan called the idea “ridiculous and disgraceful,” adding that Democrats “want to play politics with the debt ceiling.”

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

An hour later, the four leaders met with Trump. Republicans entered the meeting proposing an 18-month increase to the debt limit, which would put the issue aside until after the midterm elections. Trump rejected that and so Republicans floated six months. But Pelosi and Schumer stuck to their three-month demand.

Treasury Secretary Steve Mnuchin, who was also present, argued in favor of a longer-term debt limit extension, but the president cut him off and sided with the Democrats, multiple sources with knowledge of the meeting said.

In an unexpected turn of events, Ivanka Trump, the president's daughter and adviser, came into the room to say hello toward the end of the meeting, which derailed the conversation and left the Republicans visibly annoyed, a Democratic aide briefed on the meeting said.

AshLee Strong, a spokeswoman for Ryan, called that characterization of Republican reaction "false." And a White House aide said that Trump invited his daughter in to talk about her child-tax credit proposal, that she stayed on-topic and that it was “not an issue.”

Related: House Overwhelmingly Approves Disaster Relief

Back on Capitol Hill, there was a mixture of resignation and outrage.

At the weekly lunch for Senate Republicans, McConnell, joined by White House budget director Mick Mulvaney and Vice President Mike Pence, laid out the deal reached with Democratic leaders.

When asked if they were surprised at the deal that was made, some senators appeared unfazed.

“Nothing shocks me around here,” said Sen. John Kennedy, R-La.

“Am I surprised? Not really,” said Sen. Bob Corker, R-Tenn.

Still, senators were left unsure of how they’d vote on the deal, even though it includes nearly $8 billion in immediate relief for Harvey victims.

“We are literally funding this government on 90-day notes. That is not the way to fund the largest, most relevant entity in the world,” said Sen. Dan Sullivan, R-Alaska.

He said that he’s likely to vote for it because of the desperate need of people in Texas, adding, “patience is wearing thin on short-term funding of this government.”

Some Republicans, however, fumed. During a lunch of the conservative Republican Study Committee, members unanimously voiced their opposition to the deal, an aide said.

Rep. Mark Meadows, R-N.C., said Republican leaders didn’t go into the talks with a good enough proposal.

“You've got to give the president conservative options," Meadows said. "There was not a conservative option on the table. It was either a clean debt ceiling or this deal. And when we look at that you can’t criticize somebody when there’s not a conservative proposal that’s put forth."

Rep. Mark Walker, R-N.C., chairman of the conservative Republican Study Committee, said Mnuchin and Republican leaders have been pushing for a way to find the easiest path to pass a debt ceiling with no reforms attached.

“They’ve been trolling along looking for something to attach it to,” Walker said of Republican leaders. “To use the pain and suffering of the people of Texas to me is offensive."

Trump praised the deal aboard Air Force One on his way to North Dakota for a speech on tax reform. But he said he had a very good meeting with Pelosi and Schumer, and didn’t even mention the leaders of his party — McConnell and Ryan.

He also said that the debt ceiling must always be lifted without question, a position not held by most Republicans, who in recent years have turned it into a lever to achieve their policy goals of budget cuts.

“We had a very good meeting with Nancy Pelosi and Chuck Schumer," Trump said. "We agreed to a three-month extension on debt ceiling, which they consider to be sacred — very important — always we’ll agree on debt ceiling automatically because of the importance of it."

The deal, however, just pushes the threat of a government shutdown to December.

“Merry Christmas,” said Sen. John Thune, R-S.D.