WASHINGTON — The Senate on Monday night voted to reopen the federal government, passing a bipartisan funding package 60-40 and sending it to the House, where a vote is expected on Wednesday to end the longest government shutdown in American history.

The final vote came after a series of procedural votes that began shortly before 6 p.m. Monday. About four hours later, seven Democrats and independent Angus King of Maine broke ranks with their party to ratify a deal negotiated over the weekend, ending a 41-day standoff that began Oct. 1.

The package funds most of the government through Jan. 30 and combines the stopgap bill with three full-year spending bills covering agriculture, military construction and veterans' affairs, and the legislative branch through the end of the fiscal year.

It also reverses layoffs of federal workers made during the shutdown and guarantees retroactive pay for furloughed employees. President Donald Trump signaled his support for the bill earlier Monday, telling reporters, "we're going to be opening up our country very quickly."

What the deal does not do is extend the Affordable Care Act subsidies that were the central Democratic demand throughout the shutdown. The enhanced tax credits, which help more than 20 million Americans pay for health insurance, are due to expire at the end of December.

Senate Majority Leader John Thune, R-S.D., has promised a vote on extending the subsidies no later than the second week of December, though the measure faces long odds in the Republican-controlled Senate and is even less likely to pass in the House.

The defections drew a furious response from the party's left. Sen. Bernie Sanders, I-Vt., said those who voted with Republicans made a "horrific mistake," writing on X that "tragically, 8 Democrats caved." Sen. Chris Murphy, D-Conn., called the continuing resolution a "mistake" that "will make things worse, not better."

Sen. Jeanne Shaheen, D-N.H., who voted for the package, said the shutdown "had been very effective in raising the concern about health care" but that Thune's promise "gives us an opportunity to continue to address that going forward." King said a 30% or 40% chance of success on the subsidies was better than the 0% assured if the shutdown continued.

When the House reconvenes on Wednesday to take up the legislation, it will be its first time in session in 54 days. Speaker Mike Johnson, R-La., who has kept the House out of session since mid-September, urged lawmakers to begin returning to Washington "right now" and said he would give 36 hours' formal notice so the chamber can vote as soon as possible. Some Republican defections are expected, which means Johnson will likely need Democratic votes as well. House Minority Leader Hakeem Jeffries, D-N.Y., said House Democrats would "not support spending legislation advanced by the Senate Republicans that fails to extend the Affordable Care Act tax credits."

Sen. Rand Paul, R-Ky., was the only Republican to vote against the package. If the House passes it, the bill goes to Trump for his signature — and the shutdown, which has left hundreds of thousands of federal workers unpaid, delayed food aid for millions of families and disrupted air travel across the country, would finally come to an end.