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 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.

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.

Thune stated: 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. 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 January 30, meaning another government shutdown could be on the horizon early next year.

The deal also includes guarantees for paid time for federal workers during the shutdown and funding for Supplemental Nutrition Assistance Program (SNAP) through next September.