The Supreme Court ruled in an 8-1 decision Monday that the federal government must pay out $12 billion to insurers who had enrolled in the Affordable Care Act's "risk corridor" program, reversing a lower court's decision that had left Washington off the hook.

The program limited both profits and losses for insurance companies that offered plans through the online exchange created by the Affordable Care Act – commonly known as ObamaCare – by having certain profits go to the Department of Health and Human Services, which in turn would give money to plans that did not bring in profits. The result was the government owing over $12 billion more than was brought in.

DIVIDED SUPREME COURT RULES FOR TRUMP ADMINISTRATION IN REQUIRING IMMIGRANT'S REMOVAL

"We conclude that §1342 of the Affordable Care Act established a money-mandating obligation, that Congress did not repeal this obligation, and that petitioners may sue the Government for damages in the Court of Federal Claims," Justice Sonia Sotomayor wrote in the court's opinion.

The Court of Appeals for the Federal Circuit had ruled that Congress had "repealed or suspended" the obligation by implication through appropriations riders. The Supreme Court noted that according to court precedent, "repeals by implication are not favored," and because Congress never directly repealed the obligation to pay the insurance companies, they are still bound by the program.

Justice Samuel Alito, the lone dissenter in the case, argued that there was no basis for a cause of action. The majority held that this case falls under the Tucker Act, under which the government waives normal immunity from lawsuits based on "the Constitution, or any Act of Congress or any regulation of an executive department, or upon any express or implied contract with the United States, or for liquidated or unliquidated damages in cases not sounding in tort."

CLICK HERE TO GET THE FOX NEWS APP

Alito argued that ObamaCare's provision that the government “shall pay” for insurance companies' losses is not enough to create a cause of action under the Tucker Act. He claimed that allowing the companies to sue has significant repercussions and allows private insurers to collect money to which they should not be entitled.

"Today," Alito wrote, "the Court infers a private right of action that has the effect of providing a massive bailout for insurance companies that took a calculated risk and lost."

Fox News' Shannon Bream and Bill Mears contributed to this report.