The US Senate has voted to end a partial 40-day government shutdown, approving funding for the Department of Homeland Security (DHS) - with the exception of immigration enforcement.

The almost six-week funding lapse has seen knock-on disruption at US airports. Security workers' salaries are paid by the DHS, and hundreds have quit since the shutdown began.

Democrats had refused to agree on a funding deal without reforms to the US Immigration and Customs Enforcement (ICE) agency, but the Senate reached unanimous agreement in the early hours of Friday after stripping ICE and parts of border protection out of the measure.

The funding measures now face a vote in the House of Representatives.

It is hoped that the package can bring an end to widespread disruption at airports across the US, where travelers have faced hours-long queues due to a shortage of Transportation Security Administration (TSA) officers at security checkpoints.

Around 50,000 agents at the TSA - which sits under the DHS - have been working without pay since mid-February due to the shutdown. This has reduced the number turning up to work each day and led to hundreds quitting.

A BBC reporter at Houston Airport on Thursday night reported that after waiting about two hours in a winding queue across one floor, frazzled travelers went up an escalator thinking they had reached the end - only to find another long line stretching towards security.

The airport is currently operating just one-third to 50% of its TSA checkpoints, said Jim Szczesniak, director of aviation for the Houston Airport System.

A few hours before the Senate vote, US President Donald Trump said on Truth Social that he would sign an executive order 'to immediately pay out TSA agents.'

'President Trump should never have had to step in to rescue TSA workers and US air travel,' said Senate Majority Leader John Thune, addressing the chamber after the vote.

'We're here because, thanks to Democrats' determined refusal to reach an agreement, there will be no Homeland Security funding bill this year,' he said. 'Instead... Republicans funded the Department of Homeland Security piecemeal. That is not the way to fund the department.'

Also speaking after the vote, Minority Leader Chuck Schumer said the package included funding for the TSA, US Coast Guard, and the Federal Emergency Management Agency.

He told the chamber that 'in the wake of the murders of Renee Good and Alex Pretti, Senate Democrats were clear: No blank cheque for a lawless ICE and border patrol.'

There has been mounting controversy over the actions of ICE agents, particularly in Minneapolis, Minnesota, where two fatal shootings occurred earlier this year.

Democrats want any deal on DHS funding to include measures like the end of masks for ICE agents, a ban on racial profiling, and a requirement for judicial warrants before agents enter private property.

The funding package now needs to pass a vote in the US House of Representatives.