The Affordable Care Act made it through its second do-or-die Supreme Court test in three years, raising odds for its survival but by no means ending the legal and political assaults on it five years after it became law.
The 6-3 ruling, a major win for the White House, stopped a challenge that would have erased tax-credit subsidies in at least 34 states for individuals and families buying insurance through the federal government's online marketplace. Such a result would have made coverage unaffordable for millions and created price spirals for those who kept their policies, many experts predicted.
"Congress passed the Affordable Care Act to improve health insurance markets, not to destroy them," Chief Justice John Roberts wrote in the majority opinion for the court. Abolishing the subsidies, he said, "could well push a State's individual insurance market into a death spiral. It is implausible that Congress meant the Act to operate in this manner."
Democrats and consumer advocates praised the result.
"If the partisan challenge to this law had succeeded, millions of Americans would have had thousands of dollars' worth of tax credits taken from them," President Barack Obama said at the White House. With Thursday's ruling, he said, "the Affordable Care Act is here to stay."
Arkadi Gerney, senior vice president at the liberal Center for American Progress, called the decision "incredibly important" and "a repudiation of what has been this five-year campaign by conservatives ... to try to undo this law."
Republicans lamented the ruling and attacked the law that has been a conservative target from the day it took effect.
"Today's ruling won't change Obamacare's multitude of broken promises, including the one that resulted in millions of Americans losing the coverage they wanted to keep," said Majority Leader Mitch McConnell, R-Ky., said on the Senate floor. "Today's ruling won't change the skyrocketing costs of copays, deductibles and premiums that have hit in the last few years."
But even a victory for the law closely identified with Obama in the case known as King v. Burwell leaves the health system with incomplete insurance coverage, rising costs and other uncertainties. The ACA itself still faces several lawsuits, although some say Thursday's decision will discourage judges from advancing the cases.
One threat the law doesn't seem to face is the possibility that future administrations could reverse the high court's decision through regulation. The King case was partly about whether the Internal Revenue Service could grant subsidies on its own authority in the face of mixed signals from Congress.
But Roberts wrote that "this is not a case for the IRS."
Such language "binds this administration and any future administration," said Kevin Russell, a partner in the Maryland law firm Goldstein & Russell, who has argued before the court.
Tom Miller, a lawyer at the American Enterprise Institute, said Roberts' decision "made it much more uphill" for a future administration or other legal challengers to dismantle the law.
Republicans controlling Congress are likely to advance legislation amending or repealing the law, analysts said.
Even so, the only bills likely to go anywhere before Obama leaves office in 2017 are those with bipartisan support that change relatively minor parts, said John Feehery, a Republican strategist at Quinn Gillespie.
Such measures might include repealing a tax on medical devices such as artery stents and artificial knees and scrapping or changing the "Cadillac tax" on high-benefit health plans, he said.
"A comprehensive alternative" to the health law "is just not going to happen" thanks to the threat of an Obama veto, Feehery said. "If [Republicans] want to do anything about the ACA, they need to help make the next president a Republican."
Even that might prove challenging. By then, the health law will be almost seven years old and deeply entwined in American life.
"With another year and a half of business as usual under the ACA, if it's a Republican as the next president, it'll be that much more difficult to make changes," said Joseph Antos, a health care economist at the American Enterprise Institute.
The case hinged on tax credits created by Congress to help middle-income consumers buy insurance through online marketplaces, also known as exchanges.
The subsidies are available through an exchange "established by the state," according to the law.
Thirty-four states did not set up their own exchanges and rely instead on healthcare.gov, run by the federal government. Lawyers for the plaintiffs argued that, as a result, millions of consumers in those states should not receive tax credits to pay premiums.
Justice Antonin Scalia agreed. "Today's interpretation is not merely unnatural; it is unheard of," he wrote in the dissenting opinion. "Who would ever have dreamt that 'Exchange established by the State' means 'Exchange established by the State or the Federal Government'?"
The Supreme Court of the United States has shown such partiality to the health law, he added, that "we should start calling this law SCOTUScare."
Pulling the subsidies would have undermined the insurance market in those states to the point of likely failure, experts said. Unable to afford the coverage, many consumers would have dropped out. Those remaining would probably have been older and sicker, driving up premiums to unsustainable levels.
Eighty-five percent of those who bought insurance through healthcare.gov qualified for subsidies averaging $272 per month. The Department of Health and Human Services predicted 6.4 million people would have lost subsidies if the court ruled for the plaintiffs.
Those subsidies are effectively revenue for hospitals and health insurers, financing premiums and the cost of care. Both industries are relieved they were upheld.
"The possible loss of the subsidies would have been chaotic for millions of people and for the health care providers who are trying to play by the rules," said Alan Levine, CEO of Mountain States Health System in Johnson City, Tenn.
"I'm ecstatic and extremely pleased," said George Masi, CEO of Harris Health System, a Houston agency that cares for the poor at two public hospitals and numerous clinics.
A loss for the administration would have affected employer-based coverage as well, although not nearly as much, benefits lawyers said.
For large employers not offering health insurance, penalties are triggered when workers obtain subsidies in the marketplaces. No subsidies, no penalties, so employers could have dropped coverage without fearing fines.
Although employers are focused on complicated, health-law reporting requirements that take effect this year, their situation changes little in the wake of the decision, said Edward Fensholt, a benefits lawyer with brokers Lockton Companies.
"The working assumption has been, 'We need to offer this coverage to our full-time employees or we're going to risk these penalties,' " he said. "And that's not going to change."
ACA supporters said the lack of a reference to tax credits for the federal exchange was a drafting error and that Congress intended for subsidies to be available regardless of the platform. Lawyers for the plaintiffs said the government must follow the letter of the law.
The health law faces other legal cases, including objections from religious institutions to their role in providing birth control coverage and a suit by the House of Representatives contending that Obama's delay in requiring employers to offer coverage was illegal.
But even if legal challenges to the law disappear, health insurers, doctors and hospitals face broad uncertainty.
Signups for 2015 exchange coverage were lackluster. At the end of March, a little more than 10 million people had enrolled and paid for insurance, less than the 13 million the nonpartisan Congressional Budget Office was projecting last year.
Supporters of the law are pushing for more states to expand Medicaid, renewed enrollment efforts for exchanges and new measures address coverage affordability.
"Everyone who is involved with it knows there are issues where it can be improved," Linda Blumberg, a senior fellow at the Urban Institute, said after the ruling. "Having this litigation behind us allows us to look at the law very carefully at which areas can be improved and what's the best way to do it."
Health costs seem to be creeping up again in a system that is already the most expensive in the world, although there is partisan disagreement on whether the health law is containing expenses or fueling them.
In recent years large, self-insured employers have seen decades-low health-spending increases of 4 or 5 percent a year, said Dale Yamamoto, an independent actuary who works closely with such companies. So far this year those companies are seeing 6 or 8 percent, he said.
"Everyone I'm talking to -- it sounds like they've started to go up this year," he said. "If it's going up for them, it's probably going up on the individual side as well."
[Kaiser Health News (KHN) is a nonprofit national health policy news service. Jay Hancock joined Kaiser Health News in 2012 from The Baltimore Sun, where he wrote a column on business and finance. His email address is email@example.com. Follow him on Twitter: @JayHancock1. Jordan Rau, Julie Appleby, Phil Galewitz, Lisa Gillespie, Anna Gorman, Shefali Luthra and Alana Pockros contributed to this story.]