U.S. President Barack Obama speaks about the Supreme Court's ruling to uphold the subsidies that comprise the Affordable Care Act, aka Obamacare, in the White House Rose Garden in Washington, D.C., on June 25, 2015. SAUL LOEB/AFP/Getty Images

A flurry of panicked uncertainty preceded Thursday’s Supreme Court decision in the case King v. Burwell, the latest major legal challenge to the Affordable Care Act. With predictions of so-called death spirals and a scramble among states to consider contingency plans, many braced for the worst.

Then the ruling came down. By a vote of 6-3, the Supreme Court upheld subsidies for the millions of people who needed them to buy health insurance. In an opinion written by Chief Justice John G. Roberts, the majority deployed a reasoned tone to explain its decision in a legal challenge that many deemed ridiculous, while the minority opinion, penned by Justice Antonin Scalia, derided the court’s decision.

Had the court ruled against the subsidies, which are available to those whose incomes are between 100 percent and 400 percent of the federal poverty line, 8.2 million people would have been rendered unable to afford health insurance. The justices in the majority took this possibility into account, saying that it compelled them “to reject petitioners’ interpretation because it would destabilize the individual insurance market in any State with a Federal Exchange, and likely create the very ‘death spirals’ that Congress designed the Act to avoid.”

At issue in the case was the phrase declaring that federal subsidies, in the form of tax credits, were available to those purchasing health insurance on exchanges “established by the State.” The plaintiff in King v. Burwell argued that people living in the 34 states that chose to rely on the federal exchange instead of establishing their own, were therefore ineligible for such assistance.

But although it noted the ambiguity of the phrase “established by the State,” the court ultimately disagreed with the plaintiff’s interpretation and determined that two different sections of the law did not suggest that federally and state-created exchanges “differ in any meaningful way.”

“In other words, State Exchanges and Federal Exchanges are equivalent -- they must meet the same requirements, perform the same functions, and serve the same purposes,” Roberts wrote.

Even as he upheld the legality of subsidies, the chief justice also acknowledged the imperfect wording distributed throughout the law that led to the case in the first place. “The Affordable Care Act contains more than a few examples of inartful drafting,” he wrote. “The Act does not reflect the type of care and deliberation that one might expect of such significant legislation.”

Justice Antonin Scalia, who was joined by Justices Clarence Thomas and Samuel Alito, penned a scathing dissent. “This case requires us to decide whether someone who buys insurance on an Exchange established by the Secretary gets tax credits,” he wrote. “You would think the answer would be obvious -- so obvious there would hardly be a need for the Supreme Court to hear a case about it.”

He described the majority’s ruling as “interpretive jiggery-pokery,” to the delight of Twitterati.

Supporters of the law hailed the ruling, even as they turned to the fact that the law contained much room for improvement or pointed to other changes they wanted to see in the healthcare system.

“The nation’s nurses will never rest until all Americans are guaranteed access to a single standard of quality care, not based on ability to pay, socio-economic status, or what state you live in,” Jean Ross, co-president of National Nurses United, said, calling for an expansion of Medicare that would cover all.

“Looking at the larger picture, the financial hurdles for Americans looking to keep their health insurance costs affordable are about to get bigger than the Supreme Court’s action alone can fix,” Jeff Smedsrud, chief executive of HealthCare.com, pointed out. More healthy people needed to be convinced to buy health insurance in order to keep costs low for everyone, and they should be rewarded for leading healthy lifestyles, he said.

Minority and women’s rights leaders and groups saw the decision as particularly important, highlighting the fact that those populations would have been particularly harmed by a ruling striking down subsidies.

“This ruling by the Supreme Court ensures that millions of Americans, particularly the underserved, poor and minority communities, can enjoy without uncertainty access to affordable healthcare,” Rep. G. K. Butterfield, D-N.C., chairman of the Congressional Black Caucus, said in a statement.

The ruling was also crucial for women since health insurance under the law helps them afford contraception that would help them plan families and avoid unintended pregnancies, Nancy Northup, president and CEO of the Center for Reproductive Rights, noted.