Instead of having to absorb a feared rejection of the law he spent more than the first year of his presidency achieving, including its controversial individual mandate on Americans to buy health insurance, Mr. Obama has been thrown a lifeline by the unexpected acquiescence of Chief Justice John G. Roberts Jr.
Chief Justice Roberts' break from the usual conservative Republican majority in joining the four liberals on the court had to shake the confidence of the GOP right wing. Many in that camp believed they had a dependable ally in their concerted effort to end what they call "Obamacare" and to oust the president in November.
The decision, beyond preserving the critical method of financing the health care act, also keeps in place two of its most popular provisions -- removing pre-existing medical conditions as a bar to insurance and extending coverage of dependent children to age 26. Both are considered strong potential vote getters for Mr. Obama in the fall. The one provision ruled unconstitutional, which required states to expand their Medicaid to the destitute elderly, does allow those states that wish to comply to do so.
The 5-4 ruling on the individual mandate will only intensify the political battle over the law, as Republican leaders in Congress had already said in advance of it that they would campaign on a slogan to "repeal and replace" the Obama plan. A Supreme Court decision throwing out the law would have been a heavy burden for the president to carry in his re-election effort.
Instead, it poses a severe challenge for prospective Republican presidential nominee Mitt Romney, who has committed himself to getting rid of the federal law that was patterned in part on his own health care reform as governor of Massachusetts, pointedly including the individual mandate financing mechanism.
The decision comes at a time when the Obama campaign's optimism had been slipping badly, with economic recovery appearing to falter. Then the usually unflappable president added to his woes by insisting in a major speech that the private sector was "doing fine." He quickly backtracked, but the comment stepped on his message.
Now the debate over his hard-won health care reforms, which could have been an unwelcome diversion in the campaign, will be a subject the Obama campaign will be more willing to address, with the court's approval of its main features bolstering the president's argument.
With most of the Obama law remaining in force, Mr. Romney will be under more pressure not only to promise that his election will lead to repeal but to spell out in detail what reforms he would replace it with. He has already said his Massachusetts plan is not a one-size-fits-all remedy,
Meanwhile, Republican leaders can no longer rely on their prior general assumptions that there was a dependable conservative bloc with Chief Justice Roberts at its head to be a bastion against liberal Democratic programs. Nor can many Democrats maintain their previous smug certainty that the court will be a losing battleground unless Mr. Obama is re-elected and has a chance to make one or more additional nominations in a second term.
Four members of the court are in their 70s, two of them Republicans, Antonin Scalia and Anthony M. Kennedy. Justice Kennedy has been regarded as most likely to cast a swing vote, but on the health care issue he stayed with the conservative minority.
Justice Scalia, the ideological leader of the conservative bloc often given to biting sarcasm and vitriol from the bench, earlier this week made derisive comments about Mr. Obama on the issue of immigration. His remarks led to some calls for his resignation for venturing into the political arena.
However, the vote on health care for once put Justice Scalia in the shadows and may well have boosted the integrity of a court itself, which has been under a cloud since its ruling in 2000 that decided a presidential election.