WASHINGTON — A federal appeals court in New Orleans ruled against part of the Affordable Care Act on Wednesday — providing a limited victory for President Donald Trump and his Republican allies but not overturning most parts of the sweeping 2010 health care law.

The ruling by two GOP-appointed judges on the 5th Circuit Court of Appeals had threatened to strip health protections and insurance coverage from tens of millions of Americans.

For now, however, the case will return to a federal district judge in Texas for further proceedings while the law remains fully in effect. That likely means a final ruling in the case will not come until well after next year’s presidential election.

Republican state attorneys general from Texas and 17 other conservative-leaning states brought the latest court challenge to the health care law, commonly known as “Obamacare,” and the Trump administration joined in. California and a group of Democratic states stepped in to defend the law.

Democrats have made the administration’s embrace of the lawsuit a major plank of their push to defeat the president and other Republicans, who have not detailed how they would replace lost health protections if the health care law were scrapped.

If Texas and its allies were to full prevail, the case could strip coverage from as many as 20 million people and eliminate scores of other protections contained in the health care law, including prescription drug assistance for seniors who rely on the Medicare Part D program and a popular rule allowing young people to remain on their parents’ health plans until they are 26.

The lawsuit centers on a provision in the 2017 tax bill that eliminated a tax penalty on Americans who don’t have health insurance. The tax bill did not change the technical requirement in the health care law that Americans have coverage, the law’s so-called individual mandate.

The coverage requirement and the penalty were once considered integral parts of the health care law. At the time the law passed, insurers, state regulators and other experts believed that unless there was a penalty for going uninsured, younger and healthier people would not buy health plans until they got sick, leading insurance markets to collapse.

The penalty was also crucial to the health care law’s survival when it first came before the Supreme Court in 2012 in a lawsuit that alleged the insurance requirement was unconstitutional.

In the 2012 case, Chief Justice John G. Roberts Jr. joined the court’s four liberal justices to uphold the law. Roberts upheld the requirement that all Americans have insurance because the penalty that enforced it could be considered a tax, which Congress had the power to enact.

In the current case, Texas and the other conservative states argued the requirement to have insurance was no longer constitutional because Congress reduced the tax penalty to zero as part of the 2017 tax cut law.

More importantly, they said that because the requirement was central to health care law, the entire law would have to be struck down if the mandate were unconstitutional.

That argument was once considered a legal long shot by experts on the left and right. But in December, a federal judge in Texas appointed by former President George W. Bush backed the plaintiffs’ argument. He ruled that the coverage mandate was a key part of the law and as a result, the entire law was unconstitutional.

In the appeals court, California and the other Democratic states argued that Congress had no intention of wiping out the health care law when it zeroed out the tax penalty. The Senate, just a few months earlier, had rejected a measure to roll back the law, they noted. And, they said, with no penalty to enforce it, the mandate to have insurance was no longer truly a requirement and couldn’t be considered a constitutional problem.

The appeals court sided partially with the conservative states.

Judge Jennifer Walker Elrod, who was appointed by President George W. Bush, and Judge Kurt Engelhardt, who was appointed by President Donald Trump, wrote in their ruling that they agreed the requirement to purchase coverage was no longer constitutional.

But, they said, it was unclear whether others parts of the law should be struck down. Because the federal government had changed its position in the case several times, they said, the case should go back to the district court for further proceedings to determine which, if any, parts of the law should be considered invalid.

The third member of the appellate panel — Judge Carolyn Dineen King, who was appointed by President Jimmy Carter — dissented. Since Congress reduced the tax penalty to zero, she said, the entire issue was nothing but an “academic curiosity.”

“People can purchase insurance — or not — as they please,” she wrote. “No more need be said.”