WASHINGTON — A federal appeals court ruled Wednesday that the individual mandate in the Affordable Care Act, better known as Obamacare, is unconstitutional. But it sent the case back to the trial judge for another look at whether the entire law is invalid or if some parts can survive.

The nature of the decision and the fact that it comes so late in the year make it highly unlikely that the Supreme Court will weigh in on the fate of Obamacare during its current term, which ends in June.

"Anything is possible, but it would require extraordinary effort," said Tom Goldstein, a Washington lawyer who argues frequently before the Supreme Court.

By a 2-1 vote, the 5th Circuit Court of Appeals in New Orleans agreed with Texas and 17 other red states that the key part of the law is unconstitutional — the provision that requires all Americans to buy insurance or pay a penalty on their income tax. The Supreme Court upheld the law in 2012, ruling that it was a legitimate exercise of Congress's taxing authority.

The states then sued after the Republican-led U.S. House in 2017 set the tax penalty at zero. The appeals court agreed with a Texas trial judge who first heard the lawsuit. He ruled that because the tax was eliminated, the law could no longer be saved as a use of Congress' taxing power.

"The provision's saving construction is no longer available," the appeals court said.

Without the tax, it concluded, Congress has no authority to require Americans to buy health insurance. "It is an individual mandate, not an individual suggestion."

Judge Carolyn Dineen King dissented, agreeing with the law's defenders who said by setting the tax at zero, the law effectively had no mandate because the penalty for not buying insurance was eliminated.

The ruling Wednesday ordered the trial judge to reconsider his ruling that the entire law must fall because the individual mandate was the glue that held it together.

House Speaker Nancy Pelosi, D-Calif., call the ruling "a chilling threat to the 130 million Americans with pre-existing conditions and every other family who depends on the lifesaving protections of the Affordable Care Act.

"Despite their claims to support protections for people with pre-existing conditions, Republicans have taken every opportunity to dismantle them," she added.

The appeals court said the Trump administration clouded the issue by changing its position. When the case was in front of the trial judge, the Justice Department said parts of the law could be saved. But on appeal, the government agreed with the GOP officials in the states pursuing the legal case that the entire law must be declared invalid.

Sen. Lamar Alexander, R-Tenn., chairman of the Senate health committee, criticized the effort to dismantle Obamacare altogether.

"I am not aware of a single senator who said they were voting to repeal Obamacare when they voted to eliminate the individual mandate penalty," Alexander said in a statement. "I thought the Justice Department's argument in the case was far-fetched."

The appeals court directed the judge "to employ a finer-toothed comb on remand and conduct a more searching inquiry into which provisions of the ACA Congress intended to be inseverable from the individual mandate."

Wednesday's ruling will have no immediate effect. For now, the Obamacare program continues.