WASHINGTON (AP) — The Supreme Court ruled Monday that insurance companies can collect $12 billion from the federal government to cover their losses in the early years of the health care law championed by President Barack Obama.

Insurers are entitled to the money under a provision of the “Obamacare” health law that promised the companies a financial cushion for losses they might incur by selling coverage to people in the marketplaces created by the health care law, the justices said by an 8-1 vote.

The program only lasted three years, but Congress inserted a provision in the Health and Human Services Department’s spending bills from 2015 to 2017 to limit payments under the “risk corridors” program. Both the Obama and Trump administrations had argued that the provision means the government has no obligation to pay.

The companies cite HHS statistics to claim they are owed $12 billion.

The case is separate from a challenge to the health care law that the court has agreed to hear in its term that begins in October.