House of Representatives is expected to approve the bill on Thursday and ship it to President Barack Obama for his signature.
The bipartisan 73-26 vote in the Democratic-controlled Senate was a rare thaw in the partisan gridlock gripping Washington and cleans up the unfinished business of Congress for the long-underway 2013 budget year.
Although the bill ensures there will be no interruption of routine government funding, more battles over future spending loom ahead.
The legislation provides $982 billion for federal agencies to remain in operation through Sept. 30. It provides $87 billion funding for overseas military operations in Afghanistan and Iraq.
The measure gives the Pentagon much-sought relief from a cash crunch in accounts for training and readiness.
Republicans and Democrats in Congress have struggled with two goals in approving the spending bill - preventing the government shutdown and trying to ease the impact of in spending cuts that kicked in earlier this month. Those cuts were set in motion when the White House and Congressional Republicans couldn't agree on a better plan for addressing the U.S. deficit. Republicans insisted on a plan that includes spending cuts alone, while Democrats demanded tax increases.
If the House goes along with the Senate bill, as expected, that means the budget cuts will remain in effect for the rest of the fiscal year.
Some adjustments will be made. Federal meat inspectors were spared furloughs, for example, as lawmakers in both parties alternately clashed and cooperated over proposals to take the edge off the cuts.
That was a departure from the administration's general position that flexibility should ease all the cuts or none at all.
The overall legislation extends flexibility to the Pentagon, the departments of Homeland Security, Veterans Affairs, Justice, State and Commerce and the Food and Drug Administration.
But bipartisanship has its limits, and in private negotiations Republicans rejected Democratic attempts to provide flexibility for the rest of the government.
Without changes, the $85 billion in cuts for the current year will swell to nearly $1 trillion over a decade, levels that lawmakers in both parties say are politically unsustainable.
As a result, negotiations are possible later in the year to replace the reductions with different savings to restrain high federal deficits.
The Senate pointedly rejected a call to reopen White House tours that the Obama administration says had to be canceled because of the cuts.