Congressional Democratic leaders struck a deal with President Donald Trump on Wednesday to pass a clean debt-ceiling hike and fund the government until mid-December, as well as approve the first installment of emergency relief after Hurricane Harvey.

The deal, made over the wishes of GOP leadership, will delay to the end of the year the major budgetary battles that had been expected to occupy lawmakers for most of September.

Word of the agreement came shortly after the House voted overwhelmingly to pass a $7.85 billion package to assist with recovery efforts after Harvey – which made landfall in Texas last month as a Category 4 hurricane – devastated Houston-area communities.

As recently as Wednesday morning, Senate Republicans planned to attach a debt-ceiling extension to the Harvey aid measure, which would have required the House to vote again before sending the measure on to Trump for his signature.

But Trump roiled that strategy by throwing his support behind a plan proposed by Democratic leaders that involved extending the debt limit for just three months.

"In the meeting, the president and congressional leadership agreed to pass aid for Harvey, an extension of the debt limit, and a continuing resolution both to Dec. 15, all together," Senate Minority Leader Chuck Schumer, D-N.Y., and House Minority Leader Nancy Pelosi, D-Calif., said in a statement following a meeting with Trump and top Republicans at the White House on Wednesday.

"Both sides have every intention of avoiding default in December and look forward to working together on the many issues before us," they said.

Trump also confirmed the extraordinary deal, telling reporters on Air Force One en route to North Dakota that he had agreed to the package after a "very good meeting with" Pelosi and Schumer.

"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," he told reporters.

Trump jumping on board with Pelosi and Schumer was a slap to Senate Majority Leader Mitch McConnell, R-Ky., and House Speaker Paul Ryan, R-Wis., as GOP leaders at the White House meeting reportedly wanted an 18-month debt-limit extension and were willing to settle for six months before Trump agreed to the Democrats' proposed three-month plan.

After a meeting with his conference Wednesday afternoon, McConnell confirmed the deal and said he would add the debt-ceiling extension and a three-month continuing resolution to fund the government to the Harvey aid bill passed earlier in the day by the House.

"I'll be supporting it," McConnell told reporters.

Despite Republican congressional leaders’ obvious disagreement with Trump, McConnell nodded to the devastation wrought by Harvey and the prospect of more relief needed as Hurricane Irma threatens Florida.

"We'll try to get 60 votes and move forward," he said. "The president can speak for himself, but his feeling was we needed to come together to not create a picture of divisiveness at a time of genuine national crisis."

The $7.85 billion Harvey recovery package – $7.4 billion of which will go to the Federal Emergency Management Agency and another $450 million to the Small Business Administration's disaster-loan program – breezed through the lower chamber on Wednesday afternoon in a 419 to 3 vote.

Republican Reps. Justin Amash of Michigan, Thomas Massie of Kentucky and Andy Biggs of Arizona provided the sole votes against the measure.

"Congress should provide disaster relief funding, and we should pay for it now instead of billing our children and grandchildren for it," Amash tweeted .