The White House said President Barack Obama will sign the bill. He has until Friday to sign the measure and keep federal offices open and operations intact. The House passed the legislation on Tuesday.
Some consider the measure a victory for Republicans, giving the GOP early but modest success in its drive to rein in government.
The bill includes $4 billion in spending cuts, including some accounts that Obama already has proposed eliminating.
The final vote was a sweeping 91-to-9 in favor of the bill.
The GOP won control of the House and gained seats in the Senate last fall with the backing of tea party activists demanding deep, immediate cuts in federal spending. They say that an early down payment on those cuts would send a confidence-building signal to financial markets and the business community.
Despite Wednesday's vote, difficult negotiations still loom among House Republicans, Senate Democrats and the White House over the full-year spending measure. It blends cuts across hundreds of programs - education, the environment, homeland security and the IRS among them - with a slew of provisions that attack clean air and clean water regulations, family planning and other initiatives.
The Associated Press contributed to this report.