(Adds Senate procedural vote upcoming, details)
WASHINGTON, Jan 18 (Reuters) - Legislation to avoid a U.S. government shutdown at midnight on Friday advanced in Congress, as the House of Representatives on Thursday night approved an extension of federal funds through Feb. 16, although the bill faced uncertain prospects in the Senate.
On a mostly partisan vote of 230-197, the Republican-controlled House approved the stopgap funds, sending the bill to the Senate for consideration before the looming deadline and as President Donald Trump pushed hard for a measure he can sign.
But a mix of Democrats and Republicans in the Senate who oppose the House bill for varying reasons left the measure in a precarious spot.
The Senate was expected to begin considering the House-passed bill later on Thursday, with a first procedural vote likely.
House passage came only after conservatives secured a promise from House Speaker Paul Ryan that he would soon advance some type of legislation to bolster U.S. military readiness, said Republican Representative Mark Meadows.
Meadows, head of the conservative House Freedom Caucus, did not provide details and Ryan aides were not immediately available for comment.
Besides a long fight over military versus non-military funding, Republicans and Democrats were battling over protecting from deportation young immigrants known as "Dreamers" brought to the country illegally as children.
In September, Trump said he was ending former President Barack Obama's Deferred Action for Childhood Arrivals program that has been shielding around 700,000 of the immigrants, who are mostly from Mexico and Central America.
As of late on Thursday, there was no visible sign that Republicans who control Congress would meet Democrats' demands for including a plan for the "Dreamers" in the temporary spending bill.
Without action by Congress, those immigrants could be subject to deportation after March 5, a deadline set by Trump.
Besides extending government funding for a month to give negotiators more time to work on a longer deal, the temporary spending bill would extend for six years the Children's Health Insurance Program (CHIP) for low-income families.
Republicans inserted the measure in a move to lure Democratic support.
Nevertheless, Senate Democratic leader Chuck Schumer said earlier on Thursday that the House bill to fund the government was very likely to be unacceptable to the Senate."
With the fate of the spending bill uncertain, federal agencies were being instructed to prepare for partial government shutdowns throughout the country on Saturday.
If money were to run out, many federal agencies would be shut down and workers sent home. But "essential services" dealing with public safety and national security would continue.
The 2018 fiscal year began last Oct. 1. Congress' inability to agree on overall funding levels has meant that the government has been operating on a series of temporary measures that mainly kept spending at the previous year's levels.
(Reporting by Richard Cowan and Amanda Becker; Editing by Peter Cooney)