Racing against a midnight deadline, the US Congress will try on Friday to send President Donald Trump legislation to keep the government operating and avoid federal agency shutdowns that would otherwise begin on Saturday.

The House of Representatives voted 230-197 on Thursday night for a bill to extend expiring funding through February 16.

But with tempers frayed and Republicans and Democrats deeply divided over immigration legislation that has found its way into the government funding fight, the bill appeared to be on the verge of collapse in the Senate.

The government currently is being funded by a third temporary measure since the new fiscal year began in October.

"People who work for the government would be told to stay at home" - FRANCE 24 White House correspondent Philip Crowther

'If there is a shutdown, he won't go'

Trump, who was scheduled to leave for his Florida resort in the afternoon, will remain in Washington until Congress passes legislation to avert a shutdown, White House officials said.

"The trip is on ice. If there is a shutdown he won't go," one official said on condition of anonymity.

In a morning tweet, Trump accused Democrats of holding up the measure over immigration.

"Democrats are needed if it is to pass in the Senate - but they want illegal immigration and weak borders. Shutdown coming?" he said.

Republicans control the Senate but with Senator John McCain undergoing cancer treatment at home in Arizona, they will need at least 10 Democrats to reach the 60 votes required to pass a spending bill. In addition to strong Democratic opposition, at least three Republican senators have said they will not back the
continuing resolution in its current form.

Democratic Senator Joe Manchin of West Virginia has indicated he was leaning in favor of the stopgap measure. Manchin is one of 10 Democrats up for re-election this year in states Trump won in the 2016 presidential election.

When the government shuts down, which has only happened three times in a meaningful way since 1995, hundreds of thousands of "non-essential" federal workers may be put on furlough, while "essential" employees, dealing with public
safety and national security, would keep working.

Short-term funding

Nearly four months into the 2018 fiscal year, the two parties still have not agreed on top-line spending for defense and non-defense programs, rendering impossible the passage of a long-term government funding bill. Instead, Congress has been
struggling to pass its fourth short-term appropriations measure.

Amid the deadlock, more senators were raising the possibility of merely approving enough new federal funds for a few days. The idea is to put pressure on negotiators to then cut deals on immigration, defense spending and non-defense funding by next week.

The immigration fight is over Democrats' demand that 700,000 young undocumented immigrants be protected from deportation.

Given temporary legal status under a program started by former President Barack Obama, these "Dreamers," as they are called, were brought into the United States, largely from Mexico and Central America, as children. Many have been educated in the United States and know no other country.

In September, Trump announced he was ending the program and giving Congress until March 5 to come up with a legislative replacement.

Since then, however, the president has engaged in a series of spats with Congress. Trump and conservatives in Congress have used the Dreamer fight to try and win tough new immigration controls, including the president's promised border wall.

Late on Thursday, Democratic Senator Dick Durbin, who is leading the fight for the Dreamers, told reporters there had been some signs earlier in the day that talks with Republicans were taking a positive turn and a deal could be within reach.

But in a late-night speech on the Senate floor, Republican Majority Leader Mitch McConnell accused Democrats of aiming to "hold the entire country hostage" by demanding immediate resolution of a "non-imminent problem" related to immigration.

McConnell continued to push for passage of the bill approved by the House so that a government shutdown can promptly be avoided.