(Adds Trump, Ryan, Mattis, Scalise, context)
WASHINGTON, Feb 6 (Reuters) - The Republican-led U.S. House of Representatives was set to vote on Tuesday on a short-term budget measure that would avert a rerun of last month's three-day partial government shutdown, as lawmakers continued to grapple with divisive immigration measures.
The stop-gap measure drafted by House Republicans would extend temporary funding for much of the government through March 23 and fund the military through Sept. 30, the end of the fiscal year. It also would provide two years of funding for community health centers, lawmakers said.
But Senate Democrats are likely to balk at the House spending bill, setting up a last-minute showdown before existing money for government agencies runs out on Thursday. Republicans also control the Senate, but with a slim 51-49 majority they need some Democratic support to pass spending bills.
To avert another shutdown, both the House and the Senate must pass at least a short-term spending bill, the latest in a series of such temporary measures that have become entwined with a months-long debate over protections for young "Dreamer" immigrants.
A vote on the House measure was expected on Tuesday evening.
Republican Senate Majority Leader Mitch McConnell suggested on Monday an increase in defense spending through Sept. 30 while lawmakers continue negotiations on spending for non-defense programs.
Democrats have rejected that idea. If the House passes a short-term funding measure with long-term defense funding it would fail in the Senate, Democratic Senate Leader Chuck Schumer has said.
Congress is supposed to pass annual spending bills before the start of the fiscal year on Oct. 1, but it rarely meets that deadline, forcing the government to work within the previous year's spending plan. That makes it harder for agencies like the Pentagon and the Justice Department to start new projects or make long-term plans.
U.S. Defense Secretary Jim Mattis told lawmakers on Tuesday that the ongoing budget impasse was hurting troops' morale and eroding U.S. military power.
Congress also faces another looming deadline, as the United States could have trouble paying its bills within weeks if lawmakers do not take the politically painful step of raising the debt ceiling.
The nonpartisan Congressional Budget Office estimates that the U.S. Treasury will likely run out of cash in the first half of March if Congress does not act.
The third-ranking House Republican, Representative Steve Scalise, said negotiations over the debt ceiling are being coupled with talks to reach a deal on this year's spending limits for defense and non-defense programs. IMMIGRATION ISSUE Lawmakers have also been struggling to reach a deal on an immigration bill, despite broad public support for helping Dreamers - immigrants who were brought to the United States illegally as children.
Democratic former President Barack Obama enacted the Deferred Action for Childhood Arrivals, or DACA, program to provide temporary protections for Dreamers, allowing them to study and work without fear of deportation.
Those protections were thrown into doubt last year when President Donald Trump ordered DACA halted on March 5, saying Congress should come up with a legislative solution. A federal court blocked the Trump administration last month from ending the program, and the administration's appeal is pending before the Supreme Court.
Democrats and Republicans in Congress are trying to agree on bipartisan legislation that would protect Dreamers and boost border security.
January's partial government shutdown came about after Democrats insisted that an immigration deal must be part of a spending package. Democrats are not taking that approach this time around for now.
Trump has said any immigration deal must also include funding for his long-promised wall along the U.S.-Mexico border, along with changes to programs for legal immigration that would assess applicants on their skills, rather than their country of origin or ties to U.S. residents. Democrats oppose that idea.
"We need a 21st century MERIT-BASED immigration system," Trump wrote on Twitter on Tuesday.
House Speaker Paul Ryan said on Tuesday that any bill that comes up for a vote in the House must have Trump's backing.
"We're not going to bring immigration legislation through that the president doesn't support," he said at a news conference. (Additional reporting by Amanda Becker; Writing by Eric Walsh, Susan Heavey and Andy Sullivan; Editing by Frances Kerry)