Image copyright Getty Images Image caption Congress had until Friday at midnight to pass a government spending bill

The US Congress has passed a short-term bill to fund the federal government until next month, averting a shutdown of government agencies.

The bill, which passed on Thursday night, does not resolve partisan disputes over immigration, health care and national security funding.

Congress must now tackle these thorny issues before 19 January, when federal funding once again expires.

One Democrat called the process an "epic failure of governing".

"The Republican majority has made a complete mess of the basics of governing," added Congresswoman Nita Lowey.

The second-ranking Republican in the Senate, John Cornyn, described it as "maddening".

"We get up and do the same thing over and over and over again," he said after the bill's passage, adding that Republicans "better recharge our batteries" and prepare for the next policy fight.

Lawmakers will take up debate on 3 January, after they return from a holiday recess.

Image copyright Getty Images Image caption Republican Senate Leader Mitch McConnell walks to the floor after the bill's passage

As the midnight Friday deadline approached, Democrats fought to add protections for undocumented immigrants who entered the US illegally as children.

Republicans want more funding for border protection in exchange for a final solution for "dreamers".

But that issue, as well as $81bn in disaster relief in the wake of wildfires and hurricanes, will be discussed in the new year.

Trump hails America's 'largest tax cut'

What promises has Trump kept as president?

Republicans also want more money for the military, but Democrats will only agree if a similar increase is seen in US domestic programmes, such as medical research and opioid treatment methods.

The US Center for Disease Control announced on Friday that overall US life expectancy dropped in 2016, due to the opioid epidemic, for a second year in a row.

The stopgap bill comes after Republicans passed a sweeping overhaul of the US tax code, which experts say will add $1.5 trillion to the federal deficit over the next 10 years.