In the end, the judge Barack Obama has often portrayed as his nemesis saved him.
By siding with the U.S. Supreme Court's liberal wing to uphold the President's signature health-care reform legislation, Chief Justice John Roberts has salvaged Mr. Obama's legacy – at least until the fall presidential election.
That Judge Roberts did so in such a roundabout way – substituting his own reason for upholding the law, instead of accepting the arguments of the Obama administration – suggests he went to lengths to avoid making the court a lightning rod during a presidential election campaign.
The court ruled Thursday that the federal government can penalize uninsured Americans who refuse to purchase health insurance. But rather than upholding the health-care law's so-called "individual mandate" on the basis of Washington's power to regulate interstate commerce – the core of the Obama administration's argument – the court justified the penalty on the basis of the federal government's power to impose unlimited taxes.
While the ruling spares Mr. Obama the ignominy of seeing his most important domestic achievement immediately erased, "Obamacare" will remain a political dividing line.
The legislation is easily the most controversial of Mr. Obama's presidency. Republican presidential nominee Mitt Romney vows to stop its implementation on the first day of a Romney administration.
So, voters – not the courts – will now determine Obamacare's fate.
"Chief Justice Roberts joined the liberal wing of the Supreme Court to give President Obama an enormous victory today in upholding the Affordable Care Act," offered Holly Fechner, a government affairs lawyer at the Washington law firm Covington & Burling.
"At the same time, he has handed Mitt Romney and Congressional Republicans a valuable gift. With the backing of the Supreme Court, they can now label the health care law a tax on middle-class Americans and campaign against [Mr. Obama] on those grounds."
Indeed, for Republicans, the health law may be the gift that keeps on giving.
The health-care law reinvigorated a Republican Party that had been decimated by the Democratic sweep of 2008. It is considered the single biggest factor in the rise of the Tea Party and in allowing the GOP to recapture the House of Representatives in 2010.
The first legal challenge was launched the very day it was signed into law by Mr. Obama in March, 2010. Lower courts upheld the law in two suits heard in Ohio and the District of Columbia. But the legislation was struck down by a U.S. appeals court in Atlanta in a case brought by 26 Republican-led states, in the most significant and closely-watched of the challenges. It is the latter case that the Supreme Court opted to review.
The main point of contention involved the law's co-called individual mandate. It requires all Americans who do not have health insurance through their employer, or a government-run program such as Medicare for seniors, to purchase coverage on their own. The Obama law would subsidize the purchase for the working poor.
The individual mandate is the linchpin allowing for the law's most popular provisions, including one that prohibits private insurers from denying coverage to people with pre-existing medical conditions or cancelling policies when people become sick.
Only by forcing healthy and sick people into the same pool can insurers afford to cover the riskiest patients. Without the mandate, some healthy people might choose to forgo coverage. But with Thursday's ruling, the federal government can penalize them (with a tax) if they refuse to purchase insurance.
The mandate originated as an idea promoted by right-wing think tanks, which justified it as a way to ensure Americans assumed personal responsibility for their health care. But once it became the linchpin of Mr. Obama's law, Republicans and Tea Partiers repudiated the concept.
Opponents of the mandate argued that the federal government's move to force individuals to purchase a commercial product – in this case, health insurance – set a dangerous precedent that would empower future administrations to make similar decrees.
Republicans won the battle for public opinion by portraying the mandate as an assault on personal freedom. A New York Times-CBS News poll earlier this month showed that fully 68 per cent of voters wanted the Supreme Court to strike down either the individual mandate or the entire law.
Most Americans also appear to believe Republican charges that the law will add trillions of dollars to the U.S. deficit in the long-term by creating a new entitlement program for the uninsured.
By siding with the court's Democratic-appointed judges, Justice Roberts avoids a potential political clash with the President. In April, Mr. Obama warned an "unelected" court against striking down a law passed by a "duly elected Congress."
Mr. Obama had previously criticized the "conservative court" for striking down limits on independent political spending by corporations, unions and wealthy individuals. And liberal Democrats have been urging Mr. Obama to make the court's perceived conservative slant a campaign issue.
But Judge Roberts, a George W. Bush nominee, has likely pre-empted such a clash. On Thursday, he joined the four liberal judges – two of them appointed by Mr. Obama himself – to make the President's day.
And possibly his career.