WASHINGTON — Chances of a government shutdown grew Monday as Republicans concluded that they would be unable to reach a long-term spending accord by the Friday deadline.

Republican leaders are now turning to a short-term funding measure in hopes of keeping agencies open while talks continue, but Democratic leaders say they are unlikely to support any deal that does not protect young illegal immigrants.

Aides to key negotiators from both parties planned to meet Tuesday in an effort to rekindle budget talks, setting up a Wednesday meeting of the leaders themselves. If they cannot agree, the government would shut down at midnight Friday for the first time since 2013.

House Republican leaders are scheduled to discuss their plans for a stopgap spending measure with rank-and-file lawmakers Tuesday evening.

Hopes of a deal to keep the government open have been complicated by lingering mistrust after an Oval Office meeting last week in which, according to several people familiar with the gathering, President Trump used vulgar terms to describe poor countries sending immigrants to the United States.

The meeting was to consider a bipartisan immigration deal to protect the “dreamers” – young immigrants brought to the United States illegally as children, including roughly 800,000 enrolled in the Deferred Action for Childhood Arrivals program that Trump has canceled.

Democratic leaders are demanding that protections for the dreamers be part of any spending deal. They have the leverage to do so because Senate Republicans would need at least nine Democratic votes to support any funding measure. Democrats also want Republicans to match military spending that Trump and many Republican lawmakers are seeking with an equal increase in nondefense funding.

“If they need Democratic votes, the overall legislation needs to meet certain Democratic criteria and be reflective of the values of the Democratic caucus and what we believe are the values of the American people,” Rep. Joseph Crowley, N.Y., chairman of the House Democratic Caucus, said in an interview.

There is also no guarantee that House Republican leaders will be able to rally a majority of their own members to support a short-term spending measure, which multiple congressional aides and a senior Trump administration official said would probably last through mid-February.

Defense hawks, in particular, are livid at further delaying a planned boost in military funding. That could mean House Republicans would also need Democratic votes to pass a short-term deal – something the minority party may not be inclined to provide this time around.

One option Republicans are strongly considering to win over Democrats, according to two aides familiar with the Republican planning, is attaching a long-term renewal of the Children’s Health Insurance Program to the stopgap. Republicans believe that many Democrats – especially senators seeking reelection this year –- will have a tough time voting against the program, which they have called a top priority.

On Capitol Hill, however, there are hopes that tensions will ease as the shutdown deadline approaches.

The government last shut down in October 2013, when Republicans opposed to President Obama’s health-care overhaul demanded its defunding. Government offices closed, and hundreds of thousands of federal employees were furloughed for two weeks before Republicans relented.

Last week’s meeting went off the rails when Trump angrily rejected a tentative deal negotiated among a small bipartisan group of senators – one that did not include any Republicans who support the strong restrictions Trump favors.

That deal would offer dreamers an eventual path to U.S. citizenship in return for border security funding, including some that could be used to construct the U.S.-Mexico border wall Trump campaigned on. And it would end rules that allow dreamers who become citizens to sponsor their parents for legal status in the United States. The deal also would curb a diversity lottery system that grants visas to 55,000 people from countries with low immigration each year. But Trump wants even stronger restrictions.

At a Thursday meeting to discuss the deal, according to Sen. Richard Durbin, D-Ill., and multiple other people familiar with the meeting, Trump referred to certain poor nations as “shithole countries” from which the United States should not accept immigrants.

Two Republican senators who attended the meeting accused Durbin on Sunday of misreporting the remark, and Trump himself waded back into the controversy Monday, accusing “Dicky Durbin” of having “totally misrepresented what was said” in the meeting.

“Deals can’t get made when there is no trust! Durbin blew DACA and is hurting our Military,” Trump tweeted Monday.

Durbin stood by his comments Monday, while fellow Democrats backed him up and said it was Trump who had a credibility problem, adding that they had no plans to abandon their demands.

Republican aides believe that the group of four deputy leaders from both chambers – the “No. 2’s,” as they are being called on Capitol Hill, including Durbin, Sen. John Cornyn, R-Texas, House Majority Leader Kevin McCarthy, R-Calif., and House Minority Whip Steny Hoyer, D-Md., – is more likely to produce a workable immigration accord, which would then unlock an agreement on spending levels and other outstanding issues.

“At the end of the day, if something’s going to be produced that can pass both chambers and get signed by the president, it’s going to come from this group,” said a Republican familiar with the talks but not authorized to comment on them publicly.

But even if the leaders make progress in the coming days, lawmakers and aides say another temporary spending measure – the fourth since the fiscal year began Oct. 1 – will be necessary to keep the government open past Friday.

When the Senate returns to work Tuesday, its first official order of business will be a procedural vote on reauthorizing the government’s authority to conduct foreign surveillance on U.S. soil. Senate Republican leaders are hoping to send the measure to the president’s desk with bipartisan support this week.

That leaves the chamber with perhaps only two full legislative days to pass a short-term funding measure, depending on what happens in the House.

“Even if we had a deal, which we don’t, there’s no time left to draft it,” said a senior Senate Republican aide, who was granted anonymity to speak candidly.

There was frustration and uncertainty among some Republican congressional aides and lawmakers Monday over the state of the spending talks.

The discussions appeared to be headed in a positive direction until the president “dropped a grenade into the middle of everything,” said a second Senate Republican aide, also granted anonymity to speak candidly. The aide voiced uncertainty about how the talks would proceed in the coming days.

There is also annoyance at the prospect of having to pursue yet another stopgap funding bill that would punt the budget talks deeper into the year.

Senior Democratic aides said they would be waiting for cues from Republicans about what to expect next.