People who buy health insurance through state exchanges established by the federal government will remain eligible for subsidies, the Supreme Court ruled Thursday.

The 6-3 decision is a victory for the Obama administration and closes the book on what might be the last significant legal challenge to the 2010 health care law.

The question before the court in King v. Burwell was whether federal subsidies to purchase insurance can flow through state health insurance exchanges created by the federal government.

Chief Justice John Roberts authored the majority opinion, representing Justices Kennedy, Ginsburg, Breyer, Sotomayor, and Kagan.

“Congress passed the Affordable Care Act to improve health insurance markets, not to destroy them,” Roberts wrote. “If at all possible, we must interpret the Act in a way that is consistent with the former, and avoids the latter.”

The Washington Post’s Robert Barnes has the full rundown:

By a 6-3 vote, a divided court affirmed an Internal Revenue Service ruling that the subsidies should be available not only in states that have set up their own health insurance exchanges, but also in states where consumers rely on the federal government exchange.

The court was interpreting a passage in the law that said the tax credits are authorized for those who buy health insurance on marketplaces that are “established by the state.”

In his dissent, Justice Scalia took a swipe at Roberts, who alienated conservatives in 2012 when he ruled to uphold the law’s individual mandate as a tax.

“Having transformed two major parts of the law, the Court today has turned its attention to a third … It rewrites the law to make tax credits available everywhere,” he wrote. “We should start calling this law SCOTUScare.”