The US Senate has passed a crucial funding bill that could bring the longest government shutdown in history to an end within days. The bill passed in a 60-40 vote late on Monday, with nearly all Republicans joining eight Democrats who splintered from the party to approve it. The deal funds the government until the end of January. The House of Representatives will now have to pass the bill before President Donald Trump can sign it into effect. Trump signalled he would be willing to do so earlier on Monday.

The deal came to fruition over the weekend after some Democrats joined Republicans and negotiated an agreement to get federal employees back to work and essential services restarted.

Republicans, who hold a 53-47 majority in the Senate, needed the measure to clear the 60-vote minimum threshold. Democratic Senators Dick Durbin, John Fetterman, Catherine Cortez Masto, Maggie Hassan, Tim Kaine, Jackie Rosen, and Jeanne Shaheen broke from the rest of their party to vote in favour of the funding bill. They were joined by Maine's Angus King, an independent who caucuses with the Democrats, who also voted to reopen the government. Only one Senate Republican - Kentucky's Rand Paul - voted with the majority of Democrats against it.

The announcement of the bill's passage was made to a largely empty room, but the senators who stayed until the end cheered and applauded. We are going to reopen government, we are going to ensure that federal employees will now receive compensation that they're earned and deserve, Senator Susan Collins, a Republican who played a key role in authoring the bill, said after it passed.

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 had wide-ranging impacts on a variety of services, including US air travel and food benefits for 41 million low-income Americans. On Monday, more than 2,400 flights across the US were cancelled, according to airline traffic tracker FlightAware, with at least 9,000 delayed.

The funding bill will now go to the Republican-controlled House of Representatives, where members have been out of session and away from Washington since mid-September. On Monday, with the Senate deal seemingly in reach, House Speaker Mike Johnson called members of his chamber back to Washington. The House will begin discussing the measure on Wednesday, though it is unclear how much time that process may take. Republicans have a two-seat majority in the House, so every vote will count.

The deal negotiated over the weekend extends funding for the federal government until January 30. It also includes full-year funding for the Department of Agriculture, military construction, and legislative agencies. Guarantees that all federal workers will be paid for time during the shutdown and funding for the Supplemental Nutrition Assistance Program (SNAP), which provides food aid to one in eight Americans until next September, are also included in the bill. The package contains an agreement for a vote in December on extending healthcare subsidies that are set to expire this year, a key issue for Democrats. Some high-profile Democrats have criticized colleagues who sided with Republicans to end the shutdown, calling for concrete guarantees on healthcare.

Senator Chuck Schumer, the minority leader in the chamber, said the package fails to do anything of substance to fix America's healthcare crisis. However, Senator Tim Kaine, one of the Democrats who voted in favour of the compromise, argued that the federal workers he represents were thanking him for reaching the deal. Senate Majority Leader John Thune promised to address healthcare subsidies by the second week of December, but House Speaker Johnson stated he would not bring the measure for a vote. Trump indicated his willingness to sign the funding bill into effect if it passes the House, describing the deal as very good.\