Compromise measure passes in 60-40 vote, sets up December vote on health subsidies.
The US Senate has approved a compromise to end the longest government shutdown in US history.
The 60-40 vote passed with the support of nearly all of the chamber's Republicans and eight Democrats.
This agreement sets up a December vote on health subsidies that benefit 24 million Americans, though it does not guarantee their continuation.
Funding for federal agencies that lapsed on October 1 has been restored, preventing any layoffs until January 30.
The bill now heads to the House of Representatives, where it is expected to be passed and sent to President
Donald Trump to sign into law.
This move comes a week after Democrats won key elections in New Jersey, Virginia, and New York City.
Critics argue that there are no guarantees that the Republican-controlled Senate or House would agree to extend health insurance subsidies.
The government shutdown, which has lasted for weeks, has disrupted food benefits for millions and left hundreds of thousands of federal workers unpaid.
It has also snarled air traffic due to funding cuts.
The agreement funds the SNAP food-subsidy program through September 30 of next year, preventing any possible disruptions if Congress shuts down again in that time.