It came hours before the deadline to raise the $16.7tn (£10.5tn) limit. The bill yanked the US back from the brink of a budgetary abyss by extending the Treasury's borrowing authority until 7 February.
It also funds the government to 15 January, reopening closed federal agencies after 16 days of partial government shutdown and bringing hundreds of thousands of employees back to work. President Barack Obama signed the bill into law early on Thursday morning.
But there are clues that the country will go through this mess again. The 11hour deal does not address many of the contentious and complicated issues that divide Democrats and Republicans, such as changes to entitlement program to tax reform.
Both sides kept talking past each other, with Republicans insisting for a time that defunding, delaying or otherwise altering Obamacare must be a part of any final deal. Democrats stood firm in insisting that they would negotiate but only after the passage of spending bill and legislation to raise the debt without anti-Obamacare add-on.
At the end, Democrats got largely what they wanted. But Republicans did get a small Obamacare concession: requiring the government to confirm the eligibility of people receiving federal subsidies under the health care program. But overall, under the bill just passed, the law commonly known as Obamacare escapes relatively unscathed.
Conservatives Republicans were crazy to even think that the shutdown would have altered Obamacare. Moderates ones pointed out how flawed the plan from the far right was from the beginning. Shutting down the government never had any real impact on Obamacare, given that most of its funding comes from mandatory spending, which wasn't touched by the shutdown. As such, a key portion of the health care law -- the health insurance "exchanges" -- rolled out on Oct. 1, as planned.
As the dust settles, a number of Senate Republicans are looking around at the rubble and wondering how badly their party may have been damaged by the ordeal. Polls have shown the GOP's popularity plummeting over the last week, just as the tea party lawmakers driving the fight appeared less and less clear what they were fighting for in the first place.
Sen. John McCain (R-Ariz.), who previously referred to tea party lawmakers as "wacko birds," said the only good thing may be that Republicans are now forced to confront their intra-party differences.
"What I hope we've all learned is that we need to come together," McCain said, touting the bipartisan plan he helped craft. "I would like to point out, if there's a ray of sunshine in this, 14 of us came together and came up with a plan that is perfectly good ... There is a strong desire not to let [a shutdown] happen again."
But former House Speaker Newt Gingrich predicts tea party and staunch conservatives in the GOP will be more energized after not getting the anti-Obamacare amendments they wanted. "They will be more embittered, more angry. They will find more ways to go after Obama because they can't find any way to get him to negotiate," he said, adding that he expects the Obamacare to become the defining issue of the next two elections cycles.
There are many reasons to criticize the Democrats for weak leadership and lack of imagination. But right now, it is the Republicans who look disorganized. The party is fractured and cowering in front of the footlights.
By Guylain Gustave Moke
World Affairs Analyst