WASHINGTON (CN) — The Supreme Court was nearly unanimous in ruling against the government Monday, reviving a $12 billion suit by insurers that lost money under the Affordable Care Act health care law overhaul.

Justice Sonya Sotomayor delivered the 8-1 opinion, which stems from a provision of the Patient Protection and Affordable Care Act intended to prevent insurers from drastically raising their premiums in the first three years.

The idea of the so-called risk corridors program was for profitable insurers to pool their money so that insurers with higher-than-expected costs could cover their costs.

Ultimately, however, the money in the pool dried up, spurring a tide of lawsuits from the insurers. Facing potentially multibillion-dollar liability, Congress included a revenue-neutral provision in the 2014 budget to stipulate that it would only make payments to insurers using money that came into the fund. The Centers for Medicare and Medicaid Services in turn announced it would only pay back 12.6% of what insurers claimed under the program.

As the lawsuits navigated the courts, the Federal Circuit ruled roundly for the government, saying the riders passed by Congress were sufficient to suspend the government’s payments to unprofitable plans “beyond the sum of payments” it collected from profitable plans.

Reversing that conclusion Monday, Sotomayor said the Risk Corridors statute was clear in saying the federal government “shall pay” the money-losing insurance plans.

Lawyers for the government failed to sway the court that Health and Human Services no longer had to pay unprofitable plans because Congress did not appropriate funds.

“In sum, the plain terms of the Risk Corridors provision created an obligation neither contingent on nor limited by the availability of appropriations or other funds,” Sotomayor wrote.

While the lone dissent Monday came from Justice Samuel Alito, Sotomayor lost Justices Clarence Thomas and Neil Gorsuch from a section of the lead opinion about legislative history cited by the Federal Circuit. Thomas and Gorsuch did not otherwise sign separate opinions about their views. They did join the final section of Sotomayor’s opinion, where she cited “a principle as old as the nation itself: The government should honor its obligations.”

“Soon after ratification, Alexander Hamilton stressed this insight as a cornerstone of fiscal policy,” Sotomayor wrote. “‘States,’ he wrote, ‘who observe their engagements … are respected and trusted: while the reverse is the fate of those … who pursue an opposite conduct.’ Centuries later, this court’s case law still concurs.”

Sotomayor’s point on trust was one echoed Monday in a statement by Kevin Lewis, CEO the insurer Community Health Options.

“The Supreme Court’s decision is a vindication of the rule of law and should restore faith that a contract with the government is not by itself a risky undertaking,” Lewis said.

The Illinois Department of Insurance received the ruling warmly as well. “The ruling makes clear that the federal government must uphold its end of a commitment with insurance companies to sell health plans on the ACA marketplace to provide coverage for millions of uninsured people, with the promise that the government would cover some of the risk,” Robert Muriel, director of the agency, said in an email.

In an October brief, the insurance companies accused the government of advancing an argument that every court previously has rejected to “quietly renege on clear statutory promises.”

“Under the government’s view, no matter how clearly Congress promises that it ‘shall pay’ sums certain, the government need not pay a penny unless and until a later Congress appropriates funds to fulfill the promise,” the brief states. “Never mind that the whole point of the risk corridors program was to induce insurers to offer policies on the exchanges despite uncertainties about the costs of insuring the previously uninsured.”

The government disputed this in its brief, telling that justices that the appropriations made for the Affordable Care Act deliberately “reserved to future Congresses the determinations whether and to what extent” to fund the risk corridors program.

Alito complained in dissent that the ruling marks the second time this term that the court has “gotten out of the business of recognizing private rights of action not expressly created by Congress.”

Citing the court’s 5-4 ruling in Hernandez v. Mesa — where the court ruled that a Mexican family did not have standing to sue a U.S. border patrol agent who shot across the border killing their 15-year-old son — Alito wrote the court had ruled to steer clear of such disputes previously.

Alito said he agreed largely with the court’s decision but did not square with his colleagues’ reading of the Tucker Act. While the majority correctly notes that prior cases have set out a test to determine if a statute is “money-mandated,” Alito wrote, it has never “inferred such a right,” to damages “in a case even remotely like these.”

“Before holding that this test requires the payment of billions of dollars that Congress has pointed refused to appropriate, we ought to be sure that there is a reasonable basis for this test. And that is questionable,” Alito wrote.

Paul Clement, an attorney with Kirkland & Ellis who represents the insurance companies, did not respond to an email request for comment.

The Justice Department is disappointed with ruling, according to a statement forwarded by a spokeswoman.

Prior reporting:

Insurers Clamor for $12B in High Court Obamacare Fight

Insurers to Get High Court Audience on $12B Obamacare Fight