Donald Trump has agreed with Democrats on a plan to provide aid to Hurricane Harvey victims, increase the debt limit and fund the government until 15 December – a move that goes against the wishes of many Republicans, who wanted the debt measure separate from the disaster relief.

Democratic leaders announced the deal shortly after the House of Representatives approved nearly $8bn in disaster aid in response to Harvey. Through their agreement with the White House, congressional leaders have been able to avert a government shutdown and a default on federal debt – at least until the end of the year.

“Both sides have every intention of avoiding default in December and look forward to working together on the many issues before us,” Charles Schumer, the top Democrat in the Senate, and House Minority Leader Nancy Pelosi said in a statement.

Mr Trump also confirmed the agreement aboard Air Force One on his way to a tax event in North Dakota. “We essentially came to a deal, and I think the deal will be very good,” the President told reporters. “We had a very, very cordial and professional meeting.”

“So we have an extension, which will go out to December 15th,” he added. “That will include the debt ceiling, that will include the CRs, and it will include Harvey -- the amount of money to be determined, but it will include -- because everyone is in favor obviously of taking care of that situation. So we all very much agree.”

On Wednesday morning, Democrats had offered to support the three-month debt limit increase along with Harvey aid.

“Given Republican difficulty in finding the votes for their plan, we believe this proposal offers a bipartisan path forward to ensure prompt delivery of Harvey aid as well as avoiding a default, while both sides work together to address government funding, DREAMers, and health care,” Mr Schumer and Ms Pelosi said in a joint statement.

But House Speaker Paul Ryan of Wisconsin pushed back against the idea, saying it was “unworkable” and “could put in jeopardy the kind of hurricane response we need to have.”

Donald Trump's international Presidential trips Show all 22 1 /22 Donald Trump's international Presidential trips Donald Trump's international Presidential trips French President Emmanuel Macron and US President Donald Trump AFP/Getty Images Donald Trump's international Presidential trips French President Emmanuel Macron and US President Donald Trump talk as they leave the Army Museum at Les Invalides in Paris AFP/Getty Images Donald Trump's international Presidential trips German Chancellor Angela Merkel and US President Donald Trump arrive for the group photo at the G7 Taormina summit on the island of Sicily in May 2017 Getty Images Donald Trump's international Presidential trips Mr Trump was pressed on the subject at the G7 summit in Italy Getty Donald Trump's international Presidential trips US President Donald Trump gives a speeech at the Warsaw Uprising Monument on Krasinski Square Getty Donald Trump's international Presidential trips US President Donald Trump and Britain's Prime Minister Theresa May during a ceremony at the NATO headquarters before the start of a summit in Brussels, Belgium Reuters Donald Trump's international Presidential trips Montenegro's Prime Minister Dusko Markovic is seen to the right of Donald Trump at a Nato summit in Brussels REUTERS Donald Trump's international Presidential trips Pope Francis meeting with US President Donald J. Trump EPA Donald Trump's international Presidential trips Pope Francis poses with US President Donald Trump and First Lady Melania Trump AFP/Getty Images Donald Trump's international Presidential trips US President Donald Trump arrives at Palazzo del Quirinale ahead of the meeting with Italian President Sergio Mattarella Ufficio Stampa Presidenza della via Getty Donald Trump's international Presidential trips US President Donald Trump is seen during a joint press conference with the Palestinian leader at the presidential palace in the West Bank city of Bethlehem AFP/Getty Images Donald Trump's international Presidential trips Palestinian president Mahmoud Abbas meets US President Donald Trump PPO via Getty Donald Trump's international Presidential trips Israeli Prime Minister Benjamin Netanyahu speaks with US President Donald Trump prior to the President's departure GPO via Getty Images Donald Trump's international Presidential trips US President Donald Trump and Israel's Prime Minister Benjamin Netanyahu shake hands after delivering a speech at the Israel Museum AFP/Getty Images Donald Trump's international Presidential trips US President Donald Trump and First Lady Melania Trump lay a wreath in the Hall of Remembrance as White House senior advisor Jared Kushner and Ivanka Trump watch on during a visit to the Yad Vashem Holocaust Memorial museum AFP/Getty Images Donald Trump's international Presidential trips US President Donald Trump visit to Yad Vashem Holocaust museum in Jerusalem accompanied by Prime Minister Benjamin Netanyahu GPO via Getty Images Donald Trump's international Presidential trips US President Donald Trump takes his seat before his speech to the Arab Islamic American Summit in Riyadh in Saudi Arabia Reuters Donald Trump's international Presidential trips Saudi Arabia's King Salman bin Abdulaziz al-Saud, US President Donald Trump and US First Lady Melania Trump look at a display of Saudi modern art at the Saudi Royal Court in Riyadh AFP/Getty Images Donald Trump's international Presidential trips US President Donald Trump and Saudi Arabia's King Salman bin Abdulaziz al-Saud take part in a signing ceremony at the Saudi Royal Court in Riyadh AFP/Getty Images Donald Trump's international Presidential trips King Salman presents Donald Trump with The Collar of Abdulaziz al-Saud Medal at the Royal Court Palace on 20 May AP Donald Trump's international Presidential trips US President Donald Trump is welcomed by Saudi King Salman bin Abdulaziz al-Saud upon arrival at King Khalid International Airport in Riyadh AFP/Getty Images Donald Trump's international Presidential trips U.S. President Donald Trump and first lady Melania Trump walk on the South Lawn prior to their first foreign trip Getty Images

“To play politics with the debt ceiling, like Schumer and Pelosi apparently are doing, I don’t think is a good idea,” Mr Ryan said.

Before the unprecedented flooding caused by Harvey devastated parts of southeastern Texas, Mr Trump’s Treasury Secretary Steve Mnuchin has been pushing for a “clean” raise to the debt ceiling, meaning one not attached to spending cuts or any other bills.

But conservatives in Congress said they didn't want to increase the US’s borrowing limit without also rolling back federal spending in the process. Democrats were expected to strongly oppose any deep spending cuts.

The new deal brokered between the President and congressional leaders has already drawn opposition from several Republicans, potentially setting up a future showdown between different wings of the party.