Image copyright Getty Images Image caption In 2013, the government did shut down in a row over healthcare

US lawmakers have reached a deal to avert a federal government shutdown after the White House backed off a threat to withhold Obamacare subsidies.

The stop-gap bill announced late on Wednesday allows Congress an extra week to reach a final deal to fund the government through September.

Congress had until Friday to negotiate a bill to keep the government running.

Democrats declared a victory after the White House agreed to continue paying the so-called cost-sharing reductions.

They refused to support the bill unless it allowed for an Obamacare provision that paid health insurance companies to help keep medical costs down for low-income Americans.

The concession comes after President Donald Trump had earlier dropped a demand to include funding for his controversial border wall in the spending bill.

"The fundamental issue is keeping the government open, that's our focus," said North Carolina Republican Patrick McHenry, a top member of the vote-counting team in the House.

A vote on the short-term bill, which funds the government until 5 May, could come as early as Thursday.

The Republican-controlled Congress wants to avoid an unpopular government shutdown, which would close national parks and monuments, lay off federal employees and delay tax refund payments.

Dems 2, Trump 0 - Anthony Zurcher, BBC News, Washington

Democrats may be in the minority in Congress, but they aren't totally powerless.

They have enough votes to block any budget agreement, thereby causing a government shutdown on the eve of Donald Trump's 100th day in office.

That's an outcome the president and his fellow Republicans want to avoid if at all possible.

The prospect that, even with control of all the levers of power in Washington, they can't even keep government functioning normally would be too much of a political embarrassment to bear.

Consequently, on two key issues - providing funding for a US-Mexico border wall and cutting an Obamacare-provided insurance subsidy for low-income people - the White House has backed away from earlier demands in order to win some Democratic support and keep the budget ball rolling along.

Fights over Obamacare and border security will eventually erupt again, of course.

But every time Mr Trump takes what appears to be a firm stand, accompanied by a string of aggressive tweets, and then quietly backs down, it gives his opponents a bit more confidence that they can go toe-to-toe with the president and prevail.

The challenges to Mr Trump's negotiating skills will only get tougher from here.

Media playback is unsupported on your device Media caption The divided newlyweds split over Trump's performance

Congressional Republicans said they were nearing a deal to fully fund the government for the 2017 fiscal year, but needed more time to "finalise" the package before the midnight deadline on Friday night to keep the lights on in government.

"I am optimistic that a final funding package will be completed soon," House Appropriations chairman Rodney Frelinghuysen said.

The resolution also extends healthcare benefits for retired union coal miners through 5 May. Those benefits would have expired on Friday as well.

The sweeping spending package would combine 11 unfinished spending bills into a single "omnibus" bill, becoming the first bipartisan legislation under Mr Trump's presidency.

Image copyright Getty Images Image caption Mr Trump was forced to back off funding for his border wall in order to reach a deal

Democrats, who are needed to pass the measure, have warned they would not support any bill that included funding for Mr Trump's wall along the US-Mexican border and eliminated cost-sharing reductions.

Meanwhile, Republicans have revived their health care bill after the key conservative group, the House Freedom Caucus, announced it would support a revised version of the measure.

Mr Trump and his party, which controls both chambers of Congress, suffered a huge blow last month when the Freedom Caucus helped derail the Republican health bill.

Republicans have vowed for several years to repeal and replace former President Barack Obama's signature Affordable Care Act.

It is unclear if moderate Republicans will back the new revisions.

How has Trump done so far?