Donald Trump has ignored the objections of Republican leaders and sided with Democrats on a deal to fund the US government and raise the debt limit for three months, in addition to providing emergency aid in the aftermath of Hurricane Harvey.

The president threw his support behind the proposal during a meeting with congressional leaders at the White House on Wednesday, hours after the House speaker, Paul Ryan, said it was both “ridiculous and disgraceful” for Democrats to suggest a short-term increase of the debt ceiling.

The agreement comes as Congress, which reconvened this week following the August recess, faces a series of pressing fiscal deadlines. Lawmakers must raise the country’s borrowing limit by 29 September and pass a spending bill by 30 September to avert a shutdown of the federal government.

“We had a very good meeting with Nancy Pelosi and Chuck Schumer,” Trump told reporters, referring to the two Democratic leaders without mentioning Ryan or the Republican Senate majority leader, Mitch McConnell, who were also present at the meeting.

“We’ll agree on debt ceiling automatically because of the importance of it,” he said aboard Air Force One, before taking off for North Dakota, where he is expected to make the case for tax reform. “We essentially came to a deal, and I think the deal will be very good. We had a very, very cordial and professional meeting.”

Trump’s comments followed a joint statement from Schumer and Pelosi, who said: “Both sides have every intention of avoiding default in December and look forward to working together on the many issues before us.”

Although they did not endorse the deal, Republican leaders said they would go along with Trump’s wishes in a press conference on Capitol Hill following the meeting.

“The president agreed with Senator Schumer and Congresswoman Pelosi. Based on the president’s decision ... we’ll try to get 60 votes and move forward,” McConnell said.

“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.”

Under the agreement, Congress will seek to advance a bill that funds the government and raises the debt limit through 15 December. The package will also include disaster aid toward the areas of Texas and Louisiana that were left devastated by Hurricane Harvey.

A source briefed on the meeting said all Republican leaders, as well as the treasury secretary, Steve Mnuchin, objected to a short-term debt limit hike. The discussion arrived at a standstill, the source said, until Trump unexpectedly agreed with Democrats on the need for a three-month extension.

A separate aide, who was also briefed on the meeting, said Republican leaders pushed for an 18-month debt limit hike before floating six months. Democrats insisted on a three-month increase and were joined by Trump. The aide also said Ivanka Trump dropped into the meeting to “say hello”, and Republican leaders were visibly annoyed by her presence.

Both aides requested anonymity to speak freely on the private discussion.

Republican leaders, faced with conservative opposition to raising the debt limit, had hoped to advance a measure that would take the issue off the table until after the 2018 midterm elections. Hard-right conservatives have long opposed raising the debt limit unless it is accompanied by spending cuts.

Top Republicans also wanted to deny any leverage to Democrats, who are seeking concessions on issues such as immigration, healthcare and tax reform.

At least one Republican senator, Ben Sasse of Nebraska, swiftly lashed out at the news, issuing a terse statement: “The Pelosi-Schumer-Trump deal is bad.”

Backlash also came from outside conservative groups who had fought against increasing the debt ceiling without also cutting spending.

“The reported deal simply exploits people who lost their homes and business to a massively destructive hurricane in order to allow business as usual to continue in Washington,” said Dan Holler, the vice-president of Heritage Action. “It is absolutely absurd.”

A short-term extension paves the way for another showdown in December, with Democrats positioned to make demands that could include resolving the fate of young, undocumented immigrants, who were left hanging in the balance by Trump’s decision to rescind the Obama-era policy that granted so-called “Dreamers” with temporary status. Democrats have been calling for a standalone vote on legislation known as the Dream Act, which would provide young immigrants who were brought to the US illegally as children with a path to permanent residency.

Trump also seemed keen to work with Democrats on that issue, telling reporters: “We discussed that also today, and Chuck and Nancy would like to see something happen, and so do I.”

Democrats have also sought legislation to stabilize the health insurance markets, which have been mired in uncertainty over the future of the Affordable Care Act. With Republicans failing thus far in their attempts to repeal and replace Barack Obama’s healthcare law, Democrats could make their support for raising the debt ceiling contingent upon funding to stabilize the health insurance marketplace established by the ACA.

If Congress does not raise the debt limit, the US will run out of money to pay its bills. Economists have said the effects of a debt limit breach would be catastrophic, with some suggesting a collapse worse than the financial crisis of 2007-08.

Republican leaders had planned to tie a longer-term debt limit increase to funding for Hurricane Harvey victims, in a bid to bring more of their members on board.

The House of Representatives overwhelmingly approved an initial $7.85bn in emergency aid for Harvey victims on Wednesday. The measure allocates $7.4bn to the Federal Emergency Management Agency (Fema) and an another $450m to the Small Business Administration. Just three lawmakers voted against the bill, while 419 voted in favor of advancing it to the Senate. That money will now be included in the broader package agreed to by Trump, Pelosi and Schumer.