A deal aimed at ending the US government shutdown has passed the Senate, paving the way for the record-breaking impasse to be broken.

After a weekend of negotiations in Washington, a minority of Democrats joined with Republicans and voted in favour of an agreement.

The vote is a procedural first step towards passing a compromise to fund the government since it ran out of money on 1 October.

It will need to clear several more hurdles - including a vote from the House of Representatives - before federal employees and services return, but it is the first serious sign of progress after 40 days of deadlock.

The current shutdown is the longest on record in the US, and until this weekend it appeared that Republican and Democratic lawmakers were locked in a stalemate.

Many government services have been suspended since October, and around 1.4 million federal employees are on unpaid leave or working without pay.

The shutdown has also had wide-ranging impacts on a variety of services, including US air travel and food benefits for 41 million low-income Americans.

The agreement was negotiated between Senate Majority Leader John Thune and the White House, with Democratic senators Jeanne Shaheen and Maggie Hassan of New Hampshire, and Angus King of Maine, an independent who caucuses with the Democrats.

Republicans - who hold a 53-47 majority in the Senate - needed the measure to clear a 60-vote minimum threshold.

They were able to attract eight votes from the other side of the aisle, while losing just one in Kentucky Senator Rand Paul, who voted against after saying the bill would increase national debt.

The deal includes an agreement for a vote in December on extending healthcare subsidies that are due to expire this year, a key issue Democrats had been holding out for concessions on.

Democratic Party leaders had said that they would not lend their support to new funding for government operations until Congress addressed the subsidies that help tens of millions of Americans pay for health insurance purchased through government-run exchanges.

I'm thankful to be able to say we have senators, both Democrats and Republicans, who are eager to get to work to address that crisis in a bipartisan way, Senate Majority Leader John Thune said ahead of the vote.

We also have a president who is willing to sit down and get to work on this issue. So I'm looking forward to seeing what solutions might be brought forward.

Thune did not say exactly what that bill would contain, which frustrated many Democrats in the House and the Senate, who argued that the Democrats who negotiated the deal did so without getting enough in return.

For months and months Democrats have been fighting to get the Senate to address the healthcare crisis, said Chuck Schumer, the party's leader in the Senate.

This bill does nothing to ensure that that crisis is addressed, he said as he confirmed he would vote against the deal.

Some high-profile Democrats have been highly critical of colleagues who sided with Republicans to end the shutdown without concrete guarantees on healthcare, with California Governor Gavin Newsom calling the decision pathetic.

The measure also includes three appropriations bills to fund agencies like veterans' affairs and agriculture, as well as a continuing resolution to finance the rest of the government until 30 January - meaning another government shutdown could be on the horizon early next year.

It also includes guarantees that all federal workers will be paid for time during the shutdown, and funding for the Supplemental Nutrition Assistance Program (Snap) - an essential food safety net for one in eight Americans - until next September.

A vote on the deal would only be the first procedural step in the new funding agreement and it would still need to be approved by the US House of Representatives, where it is likely to face its own challenges.