Updated at 1 p.m. ET

The U.S. Supreme Court on Thursday handed the Obama administration a major victory on health care, ruling 6-3 that nationwide subsidies called for in the Affordable Care Act are legal.

"Congress passed the Affordable Care Act to improve health insurance markets, not to destroy them," the court's majority said in the opinion, which was written by Chief Justice John Roberts. But they acknowledged that "petitioners' arguments about the plain meaning ... are strong."

The majority opinion cited the law's "more than a few examples of inartful drafting," but added, "the context and structure of the Act compel us to depart from what would otherwise be the most natural reading of the pertinent statutory phrase."

Roberts was joined by the court's liberal justices, Ruth Bader Ginsburg, Stephen Breyer, Sonia Sotomayor and Elena Kagan, as well as by Anthony Kennedy.

In his dissent, Justice Antonin Scalia said: "We should start calling this law SCOTUScare," an apparent reference to the fact the Supreme Court has now saved the Affordable Care Act twice. Scalia called the majority's reading of the text "quite absurd, and the court's 21 pages of explanation make it no less so."

As NPR's Nina Totenberg reported in March, opponents of the law contended "that the text of the law does not authorize subsidies to make mandated insurance affordable in 34 states."

At issue were six words in one section of the law. As Nina pointed out: "Those words stipulate that for people who cannot afford health coverage, subsidies are available through 'an exchange established by the state.' " She added:

"The government [contended] that those words refer to any exchange, whether it is set up by the state itself or an exchange run for the state by the federal government in accordance with individual state insurance laws and regulations. The challengers [said] the statute means what it says and no more."

The court agreed Thursday with the government's position.

The decision comes three years after a bitterly divided high court upheld the Affordable Care Act as constitutional by a 5-4 vote.

President Obama made a statement on the ruling late Thursday morning, saying the Affordable Care Act "is here to stay."

Copyright 2016 NPR. To see more, visit http://www.npr.org/.