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

The agreement will need to clear several more hurdles—including a vote from the House of Representatives—before federal employees and services can fully 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 various 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, who is an independent but 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 claiming the bill would increase national debt.

This deal incorporates a vote in December on extending healthcare subsidies that are due to expire this year, a key concern for Democrats.

Senate Majority Leader John Thune expressed gratitude that both Democrats and Republicans were eager to address the deadlock in a sincere, bipartisan manner. However, some Democratic leaders criticized the agreement for not sufficiently addressing the healthcare crisis.

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

After the Senate's approval, the deal must still navigate through the House of Representatives, where its passage is uncertain.