(New throughout with House passage of spending bill)
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 Democratic and Republican senators who oppose the House bill for varying reasons left the measure in a precarious spot.
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.
Besides a long fight over military versus non-military funding, Republicans and Democrats were battling over a measure to protect 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.
Early on Thursday, Senate Democratic leader Chuck Schumer said 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.
(Reporting by Amanda Becker and Richard Cowan; Editing by Peter Cooney)