The Trump administration's decision to halt payments to insurers that help millions of lower-income Americans afford coverage under the Affordable Care Act roiled the law's insurance marketplaces Friday and sparked an immediate legal challenge from nearly 20 state attorneys general.

The administration's move, which officials formalized through a filing in a federal appeals court, could throw the ACA sign-up season that begins Nov. 1 into disarray. Some insurers and state regulators are scrambling to reconsider rates for next year, and the uncertainty is sure to make an already challenging enrollment period even more so.

Yet it is unclear whether either the litigation or vehement opposition by a broad swath of the health-care industry has any chance of stopping what the president and his top aides portrayed as integral to their broader effort to dismantle the 2010 health law.

"ObamaCare is a broken mess," Trump tweeted Friday. "Piece by piece we will now begin the process of giving America the great HealthCare it deserves!"

Both supporters and critics of the ACA see the "cost-sharing reduction" payments, which help offset deductibles and other out-of-pocket expenses for roughly 7 million Americans earning up to 250 percent of the federal poverty level, as crucial for individuals buying coverage under the law.

Insurers are obligated to provide these discounts for eligible customers, even if the federal government does not fund the CSRs, as they're called; ending the payments is grounds for any company to back out of its federal contract to sell health plans for 2018. Their only other option is to raise premium rates.

In recent months, some state regulators directed ACA insurers to add a surcharge to their 2018 rates in case the payments would not be made, but insurers elsewhere may have to absorb the costs.

On Friday morning, the two main health insurance industry trade groups, America's Health Insurance Plans and the Blue Cross Blue Shield Association, issued a rare joint statement calling the payments "critical" and saying "there will be real consequences" to ending them. Consumers' insurance choices will shrink, costs will rise and the marketplaces will become unstable, they warned.

The Congressional Budget Office projected in August that eliminating the payments would increase taxpayer costs by $6 billion in 2018 and $21 billion in 2020 because federal tax credits for many Americans covered under the ACA rise when their premiums increase. The CBO also said that "5 percent of people live in areas that would have no insurers" next year if subsidies ended, but the "slightly higher number of uninsured" would be temporary. By 2020, it estimated, the uninsured rate would be "slightly lower" as more Americans took advantage of more generous premium tax credits.

A major fear among insurers is that the White House's announcement, combined with other efforts to undermine the marketplaces, will scare customers away if they see rising premiums. Many people may not understand when signing up for insurance that although the premiums may have spiked, the amount they actually pay may not be much higher because of those tax credits — which are available to people who make as much as four times the federal poverty level, or up to $97,200 in income for a family of four in 2017.

"I think it's unfortunate, because I think it can frighten consumers who may feel there isn't an opportunity for them to have affordable health care," said Diane Holder, president of the University of Pittsburgh Medical Center Health Plan.

Other parts of the health-care industry also voiced sharp alarm Friday.

The American Medical Association said in a statement that it was "deeply discouraged by the administration's decision" and urged Congress to "accelerate" its efforts to "reinstate these payments before further damage is done."

The move to cut off the subsidies quickly triggered a new round of litigation: Attorneys general from 18 states and the District of Columbia challenged it collectively late Friday in the U.S. District Court for the Northern District of California, with a request for a preliminary injunction to ensure that federal officials maintain the payments. In part, the states are concerned about the potential for rising numbers of uninsured residents and the impact that could have on health-care costs.

"It's long past time that Donald Trump learns he doesn't just get to choose what laws he'll follow or what bills he'll pay," California Attorney General Xavier Becerra (D) told reporters in a conference call.

Many of Trump's top health-care advisers — including former Health and Human Services secretary Tom Price, Domestic Policy Council Director Andrew Bremberg, and Centers for Medicare and Medicaid Services Administrator Seema Verma — had privately warned for months that stopping the payments could disrupt the individual insurance marketplace and lead to coverage losses. But others, such as Office of Management and Budget Director Mick Mulvaney, backed the move, and several federal lawyers argued that the administration lacked the legal authority to continue making the payments.

House GOP leaders have long contended that the ACA does not include specific language providing appropriations to cover the government's cost, and they sued HHS when President Barack Obama was in office. A federal court agreed that the payments were illegal, and the case has been pending before the U.S. Court of Appeals for the District of Columbia Circuit.

In their filing to the court Friday, administration officials endorsed the House GOP's position. The documents include a Wednesday legal opinion from Attorney General Jeff Sessions, informing HHS and the Treasury Department that he believes "the best interpretation of the law" indicates that money appropriated to HHS "cannot be used to fund" the subsidies.

Speaking to reporters on the South Lawn of the White House on Friday, Trump said that the money for CSRs "is going to insurance companies . . . to lift up their stock price" — although companies must provide the offsets to eligible individuals even without any federal reimbursement.

"That's not what I'm about," the president said. "Take a look at who those insurance companies support, and I guarantee you it's not Donald Trump."

Separately, Vice President Pence touted this and other steps the White House has taken to roll back the ACA.

"President Trump and I will not rest, we will not relent, until we end the Obamacare nightmare once and for all," said Pence, speaking at a gathering of wealthy donors in New York.

Meanwhile, regulators in several states began recalculating how much companies could charge customers for plans in 2018.

Massachusetts is one state that had asked for two sets of rates: one with a standard increase and another without the cost-sharing subsidies in place. The state announced Thursday that it would use the standard rates, which assumed the subsidies would continue. Several hours later, the White House announced its decision on the payments.

"The federal government's announcement on cost-sharing reductions is disruptive for our 80,000 potentially impacted members and our insurance market," Jason Lefferts, a spokesman for the Massachusetts Health Connector, said in an email.

Chet Burrell, chief executive of CareFirst BlueCross BlueShield, said his company was in talks with Maryland officials about how it would need a 20 percent additional premium increase, given the cutoff, or would face losing about $50 million next year.

Some individual consumers who now receive the subsidies fear what could lie ahead.

Robin Adler Frieden, a 58-year-old retired bank loan manager in Santa Clarita, Calif., has diabetes and congestive heart failure. While she and her husband think they can cover a monthly premium that is set to rise from $253 to more than $600 next year, she worries that co-pays for her "cocktail" of medications and frequent doctor visits may skyrocket.

"All that stuff adds up. On the cost-sharing reduction plan, it's reasonable," she said. "It's a real hardship, knowing this is a threat to our family and our livelihood."

While White House and HHS officials said Thursday that Congress can choose to appropriate the cost-sharing payments if it wishes, such a proposal would face fierce resistance from many Republicans on Capitol Hill.

[As ACA enrollment nears, administration keeps cutting support of the law]

Wall Street analysts predicted that insurers would flee the marketplaces in the coming months. Even more than the direct loss of federal funding, they said, the fact that some healthier consumers may be deterred from signing up could prompt companies' exodus.

"We expect health plans still in the exchanges to have immediate losses, some of potentially large magnitude, and a rapid exit of plans from marketplaces," Sheryl Skolnick, a research director at Mizuho Securities USA, wrote in a note to investors.

Ann E. Marimow, Colby Itkowitz, Sean Sullivan and Michael Scherer contributed to this report.