The Senate on Wednesday cleared a two-year, $1.014 trillion budget deal that prevents a government shutdown in January and brings greater fiscal stability to a federal government that has been lurching from crisis to crisis for years.

President Obama said he is pleased with the passage of the legislation, which sets spending limits for 2014 and restores $63 billion in cuts mandated under the so-called sequester, which was intended to reduce federal spending by $1 trillion over the next decade.

" It’s a budget that unwinds some of the damaging sequester cuts that have harmed students and seniors and acted as headwinds our businesses had to fight," Obama said in a statement. "It clears a path for critical investments in things like education and research that have always grown our economy and strengthened the middle class. And it will continue to reduce our deficits at a time when we’ve seen four of the fastest years of deficit reduction since the end of World War II."

The bill, passed by a vote of 64-36, constitutes a rare bipartisan spending compromise struck by lawmakers who were motivated to reach a settlement in time to avoid another government shutdown like the one in October that proved politically disastrous for Congress, particularly Republicans.

Neither party got all that they wanted. Democrats lost their fight to include in the deal an extension of federal unemployment benefits, which expire on Dec. 28. Republicans wanted to reduce spending on Medicare or Social Security and use that money to restore some of the sequester budget cuts, particularly those scheduled to hit the Pentagon.

All Senate Democrats and nine Republicans voted for the bill.

“If we didn’t get a deal, we would have faced another [stopgap funding measure] that would have locked in the automatic cuts or worse, a potential government shutdown in just a few short weeks," said Senate Budget Committee Chairwoman Patty Murray, D-Wash., one of the deal's authors.

Murray crafted the legislation with House Budget Committee Chairman Paul Ryan, R-Wis., with little input from any other lawmakers, including those appointed to the special Budget Conference Committee. The agreement is a "mini-deal," rather than a hoped-for grand bargain that would have tackled entitlement and tax reform issues.

“This vote shows both parties—in both chambers—can find common ground," Ryan said after the Senate vote. "We can work together. This bill is only a small step. We need to do a lot more. But it’s a small step in the right direction.”

Some Republicans opposed the compromise because it would reduce by 1 percent the cost-of-living increase for military retirees. Even some of the Democrats who supported the bill opposed that provision, which would save the government $6 billion if implemented as scheduled in 2015. Both Republicans and Democrats said they will work on legislation to find the money needed to restore the cost-of-living increases.

Sen. Mark Warner, D-Va., called the pension provision "an unfair hit on military retirees." He supports a proposal that would keep the cost-of-living increases intact and instead bring $6 billion into the budget through closing certain corporate tax loopholes.

Sen. Jeff Sessions, R-Ala., who opposed the bill, said the legislation includes dozens of special reserve funds that would allow the majority Democrats to bring legislation to the floor that spends money and raises taxes without requiring a 60-vote threshold.

"It would significantly weaken the enforcement of spending and revenue limits in future budgets," Sessions argued.

Tea Party groups also criticized the plan, saying it raises federal spending, and likening the government user fee increases contained in the measure to hidden tax hikes. Airline travelers are among those who will be paying more. The bill hikes a Transportation Security Agency fee from $2.50 to $5.60 per flight, which would add $23 billion to Treasury coffers but would not be used for airline security.

"It's a rip-off for citizens," Matt Kibbe, the president of FreedomWorks, said.

Senate passage of the budget accord will help bring to a close the latest partisan showdown over the federal budget that began in September, when House Republicans fought to exclude funding for the new health care law in the 2014 government spending bill. Democrats in the Senate refused to back the House's defunding plan, causing a stalemate that resulted in a 16-day government shutdown for which voters mostly blamed Republicans.

After passing a temporary funding bill to reopen the government in October, Republicans and Democrats agreed to form a bipartisan budget committee to work out a long-term spending plan, resulting in the compromise deal that Congress cleared Wednesday.

The House and Senate must now write an actual budget bill and pass it by Jan. 15.