President Trump has reached a deal with congressional Democrats to fund the government and raise the debt ceiling through Dec. 15.

The deal, reached Wednesday at a White House meeting between congressional leaders from both parties and Trump, would attach both measures to a House bill aiding communities hit by Hurricane Harvey.

"We essentially came to a deal, and I think the deal will be very good," Trump told reporters aboard Air Force One on Wednesday.

He added that "so we have an extension, which will go out to December 15th. That will include the debt ceiling, that will include the CRs, and it will include Harvey."

Democrats were the first to announce the deal, which appeared to come despite some objections from Republicans.

"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," Senate Minority Leader Charles Schumer (D-N.Y.) and House Minority Leader Nancy Pelosi (D-Calif.) said in a joint statement.

The announcement comes after Pelosi, Schumer, Speaker Paul Ryan (R-Wis.) and Senate Majority Leader Mitch McConnell (R-Ky.) met with Trump at the White House to discuss the fall agenda.

"I will be adding that as an amendment to the [House] flood relief bill," McConnell told reporters Wednesday afternoon.

McConnell confirmed he will support the agreement.

Other Republicans, possibly surprised to see the Republican president cut a deal with Democrats, soon raised their concerns.

"The Pelosi-Schumer-Trump deal is bad," said Sen. Ben Sasse (R-Neb.).

Ryan earlier in the day called the idea of adding a three-month extension of the debt ceiling to Harvey aid "ridiculous" after the Democratic leaders proposed it. The initial Democratic offer did not mention the government funding, but it has long been seen as legislation that could be paired with a debt limit hike.

If the deal clears Congress, the package would set up a end-of-the-year cliff on both funding the government and the debt ceiling.

Trump's deal with Democrats also raises new questions for both parties about what will happen next on immigration reform.

The president angered Democrats on Tuesday by announcing the end of a program, known as Deferred Action for Childhood Arrivals, that allowed young immigrants who were brought to the U.S. illegally as children to stay, get work permits and delay deportation.

Trump has asked Congress to provide legislation for the program as part of a broader immigration bill.

A Democratic aide said the three-month offer would allow Congress to avoid defaulting and give an initial round of recovery funding "while allowing Democrats to push their priorities in the upcoming negotiations, particularly the DREAM Act."

The DREAM Act would allow children brought to the United States illegally to continue to live and work freely in the country, similar to DACA.

Schumer and Pelosi added that "both sides have every intention of avoiding default in December and look forward to working together on the many issues before us."

The deal would clear the deck of the three biggest September priorities for GOP leadership amid a packed floor schedule, but it is likely to spark outrage from rank-and-file Republicans.

Conservatives were already balking over a plan to attach a debt ceiling increase to the Harvey recovery bill that cleared the House on Wednesday.

Ryan shot down an offer from Democrats earlier on Wednesday that would link a three-month debt ceiling increase and Harvey aid, accusing the Democrats of trying to "play politics with the debt ceiling."

Sen. Ted Cruz (R-Texas), whose state was hit hard by the hurricane, refused to say how he would vote if it was attached to a debt ceiling vote but said, "the best way for that relief package to move quickly is for it to be a clean package."

Ryan also faced opposition within his conference to a long extension of the debt limit.

The deal comes after the House passed a stand-alone Harvey bill in a 419-3 vote on Wednesday. That margin would likely be closer if the debt ceiling and a short-term government funding bill were added to the legislation once it reaches the Senate.

The package would set up a tough vote for many Republicans, who want to back relief for Harvey victims but do not want to vote on legislation that raises the debt ceiling or a funding bill that but does nothing to restrict future government spending.

Republicans are expected to need help from both House and Senate Democrats to get the agreement through Congress. Even if every GOP senator voted for the deal, which is unlikely, leadership will need the support of eight Democratic senators.