(CNN) A federal appeals court has found the Affordable Care Act's individual mandate unconstitutional but did not invalidate the entire law, which remains in effect.

The 2-1 decision by the 5th US Circuit Court of Appeals likely pushes any Supreme Court action on Obamacare until after the 2020 election but again thrusts the issue of health care into the forefront of the campaign -- and extends the uncertainty surrounding the future of the landmark law, long a political target for President Donald Trump and other Republicans.

The challenge was brought by Texas and a coalition of Republican states after a failed 2017 congressional repeal effort, then later joined by the Trump administration -- which, in a dramatic reversal from its earlier position, argued the entire law should be thrown out. "Let the courts do their job," Attorney General William Barr told Congress earlier this year.

The ruling should not affect the millions of Americans who signed up for 2020 coverage on the exchanges in recent weeks. Nearly 3.9 million people had selected policies through December 7, but millions more signed up or were automatically re-enrolled in policies through the end of open enrollment, which finished early Wednesday morning in most states. Protections for those with preexisting conditions -- one of the law's most popular provisions -- remain in effect.

The court case is part of what once was considered a long-shot attempt to gut the Affordable Care Act . But two courts have now sided with the argument that a key part of Obamacare -- the individual mandate requiring Americans to purchase health insurance -- is no longer constitutional.

"The most straightforward reading applies: the mandate is a command. Using that meaning, the individual mandate is unconstitutional," Wednesday's ruling states.

Judges Jennifer Walker Elrod -- appointed by President George W. Bush -- and Kurt Engelhardt -- appointed by President Donald Trump -- were in the majority. Judge Carolyn Dineen King, an appointee of President Jimmy Carter, dissented.

John Roberts and Texas's lawsuit

Legal challenges to Obamacare have continually defied predictions and its fate may be even more difficult to predict in the 2020 presidential election year -- other than the fact it will continue.

Wednesday, the panel told a lower court that it must consider whether the individual mandate can be separated from the rest of the law.

When Chief Justice John Roberts and the Supreme Court upheld the ACA's linchpin individual insurance requirement in 2012, the majority had relied on Congress' taxing power.

Texas and other Republican-led states sued after the Republican-led Congress in 2017 cut the tax penalty for those who lacked insurance to zero as part of the year-end tax overhaul. That move came after a Republican-led repeal effort failed at the last minute due to the vote of the late Republican Sen. John McCain of Arizona.

But because the individual mandate is no longer tied to a specific tax penalty, the states argue, it is unconstitutional. They also say that because the individual mandate is intertwined with a multitude of ACA provisions, invalidating it should bring down the entire law, including protections for people with preexisting conditions.

Last winter, US District Court Judge Reed O'Connor agreed and struck down the full law.

The appeals court majority agreed.

In 2012, "the individual mandate -- most naturally read as a command to purchase insurance -- was saved from unconstitutionality because it could be read together with the shared responsibility payment as an option to purchase insurance or pay a tax," Wednesday's opinion states.

"It could be read this way because the shared responsibility payment produced revenue. It no longer does so," the judges added. "Therefore the most straightforward reading applies: the mandate is a command. Using that meaning, the individual mandate is unconstitutional."

Defenders of the ACA, which include California and other Democratic-run states, as well as the Democratic-led US House of Representatives, have argued that Congress' 2017 action affected only the amount of the tax penalty, not the individual mandate or the law as a whole. They say that if lawmakers wanted to actually repeal additional Obamacare regulations, they would have done so.

Trump celebrated the ruling, which was issued in the middle of the House debate on impeachment.

The ruling "confirms what I have said all along: that the individual mandate, by far the worst element of Obamacare, is unconstitutional," the President said in a statement.

"This decision will not alter the current healthcare system," he added. "My Administration continues to work to provide access to high-quality healthcare at a price you can afford, while strongly protecting those with pre-existing conditions. The radical healthcare changes being proposed by the far left would strip Americans of their current coverage. I will not let this happen. Providing affordable, high-quality healthcare will always be my priority. They are trying to take away your healthcare, and I am trying to give the American people the best healthcare in the world."

The Department of Health and Human Services and Centers for Medicare and Medicaid Services, which administer the Affordable Care Act, did not immediately return requests for comment.

Texas Attorney General Ken Paxton praised the ruling.

"The Fifth Circuit correctly held that the individual mandate is unconstitutional," Paxton said in a statement. "We look forward to the opportunity to further demonstrate that Congress made the individual mandate the centerpiece of Obamacare and the rest of the law cannot stand without it."

What happens next

In its ruling, the court directed the lower court to look at two issues: How much of the law can stand and whether it should apply nationwide.

The appeals court said that O'Connor went too far when he invalidated the full law and needs to explain "with precision" what he believes should happen next. They advised O'Connor to use a "finer toothed comb" and conduct a more "searching inquiry" into which provisions Congress intended to be inseverable from the individual mandate.

"The rule of law demands a careful, precise explanation," the court said.

For instance, the judges questioned whether the Affordable Care Act provision requiring certain chain restaurants to disclose the calories of their menu items is tied to the individual mandate.

The judges also said O'Connor must take a second look at the law after the Trump administration made new arguments late in the game that had said the law should only be struck as it applies to the states that brought the challenge.

Invalidating the law in only the 18 states in the lawsuit would throw the nation's health care system into chaos and deepen the inequality of access to health care that already exists. Also, several provisions -- such as making it easier to obtain lower-cost versions of certain complex drugs, changing Medicare payment rates or increasing certain taxes on wealthier Americans -- would be difficult to divide up by state.

The court acknowledged that when the lower court reviews its opinion it might once again hold that the entire law must fall. But the judges urged limits, writing: "It is no small thing for unelected, life-tenured judges to declare duly enacted legislation passed by the elected representatives of the American people unconstitutional."

Supreme Court action could be delayed for years

By sending the issue back to O'Connor, Wednesday's action actually lessens the likelihood that the Supreme Court will be faced with yet another monumental challenge to Obamacare just ahead of the next presidential election.

It is exceedingly rare for the high court to accept a case that has not yet been aired and resolved by lower court judges.

"Because the Court of Appeals did not reach the larger question of whether the entire Affordable Care Act must now fall, and instead remanded that to the district court, the Supreme Court will face far less pressure to take this case now -- versus waiting until the case comes back after that remand," said Steve Vladeck, CNN Supreme Court analyst and professor at the University of Texas School of Law.

"Thus, among other things, today's ruling may allow the justices to dodge -- if they want to, anyway."

But California Attorney General Xavier Becerra, a Democrat who is leading the coalition of states defending the law, said his department is prepared to file a petition with the Supreme Court to challenge Wednesday's ruling.

"Let's get finality," he said. "Americans don't need to be jerked around when it comes to their health care."

"For California, and I think millions of Americans, it is indispensable to get clarity and certainty," he told reporters. "And the best way to get certainty is to go to the Supreme Court."

'Boggles the mind'

In her dissent, King said it "boggles the mind" that Congress wanted to strike Obamacare when it changed the tax language in 2017.

"It is unlikely that Congress would want a statute on which millions of people rely for their healthcare and livelihood to disappear overnight with the wave of a judicial wand," King wrote.

King added that she believed Texas and the other states behind the challenge did not have the legal right to bring the challenge in the first place because they could not demonstrate how they were harmed by the law.

If Congress had wanted to repeal the law "it could have done so," she wrote. "But with the stakes so high, it is difficult to imagine that this is a matter Congress intended to turn over to the judiciary."

She called the district court opinion that invalidated the entire law "textbook judicial overreach." The majority, she wrote, has ensured "that no end for this litigation is in sight."