The high-stakes showdown was playing out in a climate of chaos, unpredictability and GOP infighting that was extraordinary even by congressional standards. Reflecting the building tension, Senate Chaplain Barry Black opened Friday's session with a prayer that included, "Lord, deliver us from governing by crisis."
Before final approval, the Senate voted 79-19 to reject an effort by some Senate conservatives to block final passage of the legislation.
Led by first-term GOP Sens. Ted Cruz of Texas and Mike Lee of Utah, the band of conservatives has wanted to derail the shutdown bill. They argued such a move would have prevented Democrats from removing a provision blocking money for Obama's health care law and forced Democrats to negotiate on reining in that 2010 overhaul, which conservatives and many Republicans despise.
Yet many Republican lawmakers opposed the conservatives' tactics, worried that it was doomed to fail and would only enhance the chances of a government shutdown for which the GOP would be blamed by voters.
The lopsided roll call against the conservatives underscored the opposition they stirred in their own party. Twenty-five GOP senators voted against them, including Senate Minority Leader Mitch McConnell of Kentucky and the Senate's other two top Republicans, John Cornyn of Texas and John Thune of South Dakota.
"It is not easy to disagree with your political party," said Cruz. "But at the end of the day, what we're doing here is bigger than partisan politics. What we're doing here is fighting for 300 million Americans," who, he asserted, widely oppose Obamacare.
Senate Majority Leader Harry Reid, D-Nev., barely concealed his scorn for the conservatives' effort.
"Today, the Republican Party has been infected by a small and destructive faction," he said. Noting the increased risk of a shutdown that he said they had caused, Reid continued, "A bad day for government is a good day for the anarchists among us."
All 52 Senate Democrats and both Democratic-leaning independents voted for final passage of the overall bill. All Republicans voted no except for two who did not vote, Orrin Hatch of Utah and Arizona's Jeff Flake.
After final passage, Cruz urged on his House colleagues.
"I am confident the House of Representatives will continue to stand its ground, continue to listen to the American people and step up to respond and to stop this train wreck, this nightmare that is Obamacare," he told reporters.
Cruz issued a similar call for resoluteness by the House last week. But he angered many Republicans there when he also acknowledged he would likely lose his fight in the Senate, where the GOP is outnumbered, leaving many of his colleagues feeling they'd been launched into an unwinnable fight.
The House had previously approved a version of the shutdown bill that included the language — demanded by conservatives there — stripping Obamacare money.
That House bill would keep agencies working Tuesday, when the government's new fiscal year begins, through Dec. 15. The Senate bill shortened that date to Nov. 15 in hopes of prodding congressional committees to quickly complete spending bills bearing details of agency budgets.
GOP disunity over what to include in a separate debt limit measure forced leaders to indefinitely delay that legislation, which is aimed at preventing a damaging, first-ever federal default that the Obama administration has warned could otherwise occur by Oct. 17.
Asked Thursday whether he envisions the House approving a simple Senate-passed bill keeping the government open, House Speaker John Boehner, R-Ohio, told reporters, "I don't see that happening." GOP lawmakers said he signaled the same thing at a closed-door meeting Thursday.
They said the House might insert provisions into the shutdown bill repealing an unpopular tax on medical devices that helps pay for Obama's health care overhaul, or erasing federal subsidies for Congress' own health care coverage. They could then dare the Senate to reject the overall measure — and face the fallout from the government shutdown that would result.
But lawmakers and GOP aides cautioned that no decisions had been made, in part because it was unclear whether even those provisions would help win enough votes for House passage.
In an attempt to build support for the debt limit bill, House GOP leaders considered adding a stack of provisions.
A one-year delay of "Obamacare," expedited congressional work on tax reform and clearing hurdles to the proposed Keystone XL oil pipeline from Canada to Texas were considered certainties. Other possibilities included boosts in Medicare costs for higher earners, land transfers in California and Oregon, and repealing Federal Communications Commission restraints on Internet providers' ability to control available content.
Even so, many conservatives said the debt limit bill lacked sufficient spending cuts.