WASHINGTON (AP) — In a setback for the Obama health care law, a federal judge ruled Thursday that the administration is unconstitutionally subsidizing medical bills for millions of people while ignoring congressional power over government spending.

The ruling from U.S. District Judge Rosemary Collyer was a win for House Republicans who brought the politically charged legal challenge in an effort to undermine the law.

If the decision is upheld, it could roil the health care law's insurance markets, which are still struggling for stability after three years.

Collyer said her ruling would be put on hold while it is appealed. The White House expressed confidence it would be overturned.

At issue is the $175 billion the government is paying to reimburse health insurers over a decade to reduce deductibles and co-payments for lower-income people.

The House argues that Congress never specifically appropriated that money and has denied an administration request for it. Collyer agreed that the administration is exceeding its constitutional authority by spending the money anyway. She rejected the administration's argument that the law authorizes the money automatically because the program is considered an "entitlement" like Social Security and Medicaid.

House Republicans launched the lawsuit in 2014 over Democrats' objections. The GOP-led House had already voted dozens of times to repeal all or parts of "Obamacare," but those efforts went nowhere, failing to overcome opposition from Senate Democrats and the president.

So the House turned its focus to tying up money spent on the law. Republican House leaders asserted that the Obama administration couldn't spend money that lawmakers refused to provide.

House Speaker Paul Ryan called the decision "an historic win for the Constitution and the American people."

"The court ruled that the administration overreached by spending taxpayer money without approval from the people's representatives," he said in a statement.

White House spokesman Josh Earnest said that House Republicans ultimately would lose the case.

"This suit represents the first time in our nation's history that Congress has been permitted to sue the executive branch over a disagreement about how to interpret a statute," Earnest said.

"It's unfortunate that Republicans have resorted to a taxpayer-funded lawsuit to refight a political fight that they keep losing," Earnest added. "They have been losing this fight for six years. And they'll lose it again."

The administration is expected to appeal Thursday's ruling to the U.S. Court of Appeals for the District of Columbia Circuit, where a majority of active judges have been appointed by Democrats.

Collyer was appointed to the district court by President George W. Bush, a Republican.

About 12.7 million people are covered through insurance markets created by President Barack Obama's law. The disputed subsidies help lower-earning customers afford out-of-pocket costs, such as annual insurance deductibles and co-payments when they seek medical care.

These subsidies, called "cost-sharing reductions" are separate from the financial aid provided under the law to help people pay their monthly premiums, which would not be affected.

But that doesn't make the cost-sharing subsidies any less important. Without them, millions of people may not be able to afford to use their health insurance.

Here's why: The most popular policies are skinny plans with low monthly premiums but high deductibles and copayments. The average annual deductible for a silver plan — the kind picked by about 7 in 10 customers — is nearly $2,900, according to the consulting firm Avalere Health.

Under the law, insurers have to provide cost-sharing assistance to consumers picking a silver plan who make up to two-and-a-half times the federal poverty level, which is $60,750 for a family of four.

The government is then required to reimburse insurers for the cost of the subsidies. The administration maintains that's automatically authorized, and it doesn't have to go back to Congress for approval each year.

But Collyer rejected that argument, saying appropriating the money is up to lawmakers. "That is Congress' prerogative," Collyer wrote. "The court cannot override it by rewriting" the law.

If congressional approval is required, Congress' GOP majority can just shut off the spending. And if that happens, the administration says the only option insurers have would be to raise premiums significantly.

However, more insurers might just decide to bail out of the health law markets. Major companies already are struggling to make money on the program.

The White House had earlier argued that the House had no legal authority to pursue its lawsuit, but Collyer rejected that argument and allowed it to proceed.

In another case last year, the Supreme Court threw out a challenge to the law's subsidies for premiums. However, the legal issues in that case were much different.