WASHINGTON — Obamacare isn't going anywhere yet, but a Texas judge’s ruling that would invalidate the entire law in response to a Republican-led and White House-supported lawsuit could mean potentially years of pitched battles on health care.

The latest ruling isn't final and will inevitably be appealed to the 5th Circuit, which leans conservative but experts see as unpredictable in this case, and then potentially the Supreme Court, which has rejected previous lawsuits striking at the core of the Affordable Care Act.

It’s possible the legal fight could even extend into a second Trump term — or someone else’s first.

“Knowing how things move in the courts, it will probably take a couple of years,” Sally Pipes, president of the Pacific Research Institute and a supporter of the lawsuit brought by Republican state attorneys general, told NBC News. "They need to come up with a plan, because the 2020 election is already under way."

If the midterms are any indication, the ruling could have an impact on which person gets the job. Forty-one percent of voters named health care as their top issue in exit polls, a new high, and Democratic campaigns around the country made the Texas lawsuit and broader repeal efforts central to their message.

That leaves Republicans stuck in a familiar place that many were hoping to move past after losing 40 House seats in November.

On the one hand, they face pressure from a portion of their base to repeal most or all of the law. On the other, they're no closer to a consensus on what should replace it after repeatedly failing to pass legislation.

“They’re still doing a greatest hits revival,” Thomas Miller, a fellow at the conservative American Enterprise Institute, said. “Everyone knows the old songs, there’s a dwindling audience for it, but some people still like to hear it.”

The Texas lawsuit, while still a long way from succeeding, could trap them in this cycle for another election. As long as repeal is still on the table and the president is cheering it on, it will be difficult for Republicans to move on or maybe even pursue modest bipartisan changes with the incoming Democratic House, an approach some Republican senators, like Lamar Alexander of Tennessee and Susan Collins of Maine, have explored. (Alexander announced this week that he wouldn't run for re-election in 2020.)

None of their options so far have proven popular with voters. Republican replacement bills, which would have cut Medicaid spending, rolled back some protections for pre-existing conditions, and raised premiums and deductibles for many customers, polled as poorly as any major legislation in recent memory. After the election, some Republicans sounded eager to push the reset button.

“I think health care has proven to be extremely problematic for Republicans,” Glen Bolger, a Republican pollster at Public Opinion Strategies, said at a postmortem panel on the midterms at American University last month. “I think anything they come up with, and I don’t know that we’re anywhere near that yet, would have to include pre-existing conditions, for example.”

But a total repeal via the courts would go much further. The entire health care system is integrated with the ACA at this point and would be thrown in chaos with serious consequences for average Americans. The effects would extend well beyond people who receive subsidies to purchase insurance through the law’s exchanges, and open up seniors to higher Medicare costs on prescription drugs, throw millions of Medicaid patients into limbo, force young adults under age 26 off their parents’ coverage, and open up employer plans to lifetime and annual limits on coverage.

“This would be the biggest shock to our health care system ever,” Timothy Jost, professor emeritus at Washington and Lee University School of Law, said.

The White House, which took the rare step of refusing to defend its own administration against the lawsuit, has argued for a more narrow interpretation from the courts: They only want to throw out protections for people with pre-existing conditions.

But that’s among the most popular parts of the law, and one that drove Democratic activism and messaging more than any other aspect of repeal. In a sign of its hold on voters, an array of Republican candidates, including Trump, claimed to support the concept in the midterms even as some of the same politicians sought to alter or undo the ACA's protections.

“You had two years where people with pre-existing conditions worried that repeal would take away their health care,” Jesse Ferguson, a Democratic strategist who often works on health care issues, told NBC News. “They got six weeks of sleep after the election, and they’re now back up at night because they found out Trump went to court to strike down the provision anyway.”

Many Republicans, and even some conservative legal experts who supported the previous lawsuits targeting the law, disagreed with the ruling, leaving the party without a clear message in response. When Sen. Roy Blunt, R-Mo., was asked about it on NBC's "Meet The Press" on Sunday, he stressed that there was no immediate impact and quickly pivoted to attacking a proposal by Sen. Bernie Sanders, I-Vt., to implement single-payer health care.

"You know, I’m not in the job of questioning what state attorney generals decide they want to do," Blunt said when pressed on whether he agreed with the ruling.

The new Democratic majority in the House could try to exploit these divisions with messaging bills that force Republicans to go on record about various elements of the law or express opposition to the lawsuit. They could even pass relatively simple legislation to address the lawsuit's core arguments, potentially clearing up the threat to the ACA entirely.

Miller, the AEI fellow, predicted Republicans in Congress — unless the Supreme Court forces their hand by approving full or partial repeal — would fall back to tactics they used for many years under President Barack Obama. Rather than produce another detailed bill that could be picked over by critics and further divide the party, they’d instead talk in more general terms about maintaining popular elements while lowering costs.

“What they’ll say is, ‘We have a plan, we just haven’t agreed on it and we can't tell you what it is,'” he said. “There’s no benefit to putting out a plan that only becomes a liability that you don’t yet have to vote on.”