WASHINGTON — President Trump has sided with a Democratic proposal to tie Hurricane Harvey funding with a three-month increase to the debt limit and funding the government through Dec. 15

Trump announced the deal with “Nancy” and Chuck” after huddling with the top Democratic leaders –House Minority Leader Nancy Pelosi and Senate Minority Leader Charles Schumer – and top GOP leadership at the White House.

“We essentially came to a deal, and I think the deal will be very good,” Trump said aboard Air Force One Wednesday. “We had a very, very cordial and professional meeting.”

The Democrats touted getting the deal they essentially wanted that avoids a government shutdown Oct. 1 over the president’s border wall demands.

“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 December 15, all together,” Schumer and Pelosi said Wednesday.

“It was a really good moment of some bipartisanship,” Schumer added in the afternoon at the Capitol.

The Democratic leaders met with Trump alongside GOP Speaker Paul Ryan, Senate Majority Leader Mitch McConnell, Majority Leader Kevin McCarthy and his Treasury Secretary Steven Mnuchin.

All the Republican congressional leaders and Mnuchin wanted a longer-debt limit increase, upwards of 18-months, according to one source, but Democrats wanted just a three-month deal.

There was a standstill, but instead of agreeing to disagree, Trump wanted to solve it immediately, according to a second source briefed on the meeting. He offered to make a deal himself and offered up three months for a continuing resolution and a three-month debt limit increase.

“The president agreed with Senator Schumer and Congresswoman Pelosi to do a three-month CR and a debt ceiling into December,” a seemingly stunned McConnell acknowledged. “So that’s what I will be offering based on the president’s decision.”

Ryan called the Democratic plan for a measly three-month debt limit extension “ridiculous” and “unworkable” earlier Wednesday. That means Democrats would have leverage in three when the debt limit vote comes up again and GOP leadership needs their support.

Trump, who had previously donated to Schumer and other Democrats as a billionaire New York businessman, thanked Pelosi and Schumer for coming to the White House.

“Nancy, Chuck, I appreciate it very much,” Trump said in the Oval Office.

One aide briefed on the meeting said it got off course after Trump daughter Ivanka Trump entered the Oval Office toward the end and the meeting “careened off topic” to the annoyance of Republican leadership. An aide to Paul Ryan, however, said “that’s not true.”

Trump didn’t mention the Republicans in remarks to reporters afterwards touting the deal and instead praised the Democrats.

“We had a very good meeting with Nancy Pelosi and Chuck 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,” Trump said.

The president also suggested the hurricane aid would increase beyond the nearly $8 billion package and include relief for developing Hurricane Irma.

“Also on the CRs and also on Harvey, which now we’re going to be adding something because of what’s going on in Florida — but we had a very good meeting,” Trump said.

Previously Trump has threatened a government shutdown if a spending bill didn’t include funding for his border wall with Mexico. By agreeing to this deal, Trump backs away from his wall demands — at least through Dec. 15.

Meanwhile, the House Tuesday overwhelmingly passed a $7.85 billion aid package for Hurricane Harvey victims with broad bipartisan support.

With a 419 to 3 vote, the relief marks just the first step in a long recovery process for Louisiana and Texas. Once the damage from the massive storm and record-breaking flooding is fully assessed, another request for federal aid is expected to top $100 billion.

“Nothing can really capture just how big and wide this devastation is,” Ryan said prior to the vote on the need for immediate relief funding. “You hear a lot of numbers. Tens of thousands of people in shelters. Hundreds of thousands of homes damaged. Nothing can really capture this.”

The legislation now heads to the Senate where McConnell is expected to attach the three-month spending bill and three-month debt limit hike. That would send the legislation back to the House where very conservative lawmakers are opposed to raising the debt ceiling without concessions on spending.

The House bill includes $7.4 billion for FEMA and $450 million for the Small Business Administration.

Bipartisan New York lawmakers supported the funding, despite holding some grudges against certain Texas Republicans for holding up funding to New York and New Jersey for relief from 2012’s deadly Hurricane Sandy.

“Despite the fact that some of the representatives for areas affected by Hurricane Harvey heavily criticized and voted against the assistance provided in the wake of Superstorm Sandy, I wholeheartedly support the funding in this bill and expect a much larger request from the administration, including funding to mitigate damage from future storms,” said New York Democrat Rep. Nita Lowey, the ranking member of the House Appropriations Committee.

The three GOP ‘no’ votes were Michigan Rep. Justin Amash, Arizona Rep. Andy Biggs and Kentucky Rep. Tom Massie.

“Congress should provide disaster relief funding, and we should pay for it now instead of billing our children and grandchildren for it,” Amash explained over Twitter.