WASHINGTON (AP) -- Legislation sparing the country the specter of a catastrophic default and partial government shutdown is ready for President Barack Obama's signature after the Senate passed it by a comfortable margin.
Senators voted 64-35 for the measure, which also provides a two-year budget, in the early hours Friday. Democrats teamed with Republican defense hawks to overcome opposition from conservatives including two GOP senators running for president — Rand Paul of Kentucky and Ted Cruz of Texas.
Obama had negotiated the accord, passed by the House earlier this week, with congressional leaders who were intent on avoiding the brinkmanship and shutdown threats that have haunted the institution for the past several years. Departing Rep. John Boehner of Ohio made it his top priority in his final days as speaker before making way for Rep. Paul Ryan, R-Wis.
The deal allows members of both parties to look ahead toward next year's presidential and congressional elections. Republican leaders were particularly concerned that failure to resolve this vexing issue could reflect poorly on their ability to govern. There was significant opposition in the Senate, nevertheless, as Paul and Cruz made it a point to be on the floor to register their concerns.
In an hour-long speech that delayed the final vote to around 3 a.m., Paul said Congress is "bad with money." He railed against increases in defense dollars supported by Republicans and domestic programs supported by Democrats.
"These are the two parties getting together in an unholy alliance and spending us into oblivion," he said.
Cruz said the Republican majorities in both the House and Senate had given Obama a "diamond-encrusted, glow-in-the-dark Amex card" for government spending.
"It's a pretty nifty card," he said. "You don't have to pay for it, you get to spend it and it's somebody else's problem."
The agreement would raise the government debt ceiling until March 2017, removing the threat of an unprecedented national default just days from now. At the same time, it would set the budget of the government through the 2016 and 2017 fiscal years and ease punishing spending caps by providing $80 billion more for military and domestic programs, paid for with a hodgepodge of spending cuts and revenue increases touching areas from tax compliance to spectrum auctions.
The deal would also avert a looming shortfall in the Social Security disability trust fund that threatened to slash benefits, and head off an unprecedented increase in Medicare premiums for outpatient care for about 15 million beneficiaries.
The promise of more money for the military ensured support from defense hawks like Sen. John McCain, R-Ariz., chairman of the Armed Services Committee, while additional funds for domestic programs pleased Democrats.
Obama and Democratic allies like House Minority Leader Nancy Pelosi of California were big winners in the talks, but GOP leaders cleared away political land mines confronting the party on the eve of 2016 campaigns to win back the White House and maintain its grip on the Senate.
The measure leaves a clean slate for Ryan as he begins his leadership of the House.
Obama had repeatedly said he would not negotiate budget concessions in exchange for increasing the debt limit, though he did agree to package the debt and budget provisions.
"I am as frustrated by the refusal of this administration to even engage on this (debt limit) issue," said Finance Committee Chairman Orrin Hatch, R-Utah. "However, the president's refusal to be reasonable and do his job when it comes to our debt is no excuse for Congress failing to do its job and prevent a default."
The budget relief would lift caps on the appropriated spending passed by Congress each year by $50 billion in 2016 and $30 billion in 2017, evenly divided between defense and domestic. Another $16 billion or so would come each year in the form of inflated war spending, evenly split between the Defense and State departments.
The Appropriations committees face a Dec. 11 deadline to craft legislation reflecting the spending priorities set forth in the compromise budget bill.
The cuts include curbs on Medicare payments for outpatient services provided by certain hospitals and an extension of a 2-percentage-point cut in Medicare payments to doctors through the end of a 10-year budget. There's also a drawdown from the Strategic Petroleum Reserve, and savings reaped from a Justice Department fund for crime victims that involves assets seized from criminals.