What began over the summer as a halfhearted attempt by Republicans to push back against Democratic attacks on the issue of health care has exploded into a full-throated reversal of their positions, particularly on protections for sick Americans.

In Missouri, Republican Senate candidate Josh Hawley has been hammered by the woman he hopes to unseat, Democrat Claire McCaskill, for being among the attorneys general who have asked a federal court to render unconstitutional the Affordable Care Act, or Obamacare, which compelled insurance companies to cover those with preexisting conditions.

“You don’t go to court and get rid of important protections when there is no backup, when people will be in a free fall,” McCaskill said in a debate Thursday night. Hawley has responded by citing the illness of his young son as fueling his understanding of the importance of such protections.

In Texas, where he is trying to beat back a well-financed challenge by Democratic Rep. Beto O’Rourke, Sen. Ted Cruz said in a debate Tuesday that he would “protect preexisting conditions.” Cruz forced a government shutdown in 2013 over his effort to repeal Obamacare.

The GOP about-face is not just playing out in Senate races. Wisconsin Gov. Scott Walker, a Republican seeking a third term, has insisted that he supports maintaining the popular ACA protections, even if he is also backing the lawsuit that would end them.

In a House race in California, Republican Rep. Dana Rohrabacher is, like Hawley, using his child’s illness to attest to his embrace of protections for preexisting conditions, even though he repeatedly voted to quash the Obamacare bill that first secured them.

President Trump, who campaigned to repeal the ACA, joined in via Twitter on Thursday.

“All Republicans support people with preexisting conditions, and if they don’t, they will after I speak to them. I am in total support. Also, Democrats will destroy your Medicare, and I will keep it healthy and well!” he wrote.

Democrats and health-care specialists say that the proposals being put forward by Republicans contain exemptions that mean the sick would not be fully protected or would be charged exorbitant rates for coverage, as they were before the ACA became law.

Still, the sudden scramble by Republicans underscores the speed with which voters have also reversed themselves on the most popular provisions of the act, even as Republicans worked relentlessly to repeal them. It also raises a political irony: The same issue that gave birth to the tea party and propelled Republicans to power in the 2010 midterm elections could cost them dearly eight years later.

Republicans appeared to have been caught flat-footed about the change in voter opinion about insurance coverage, which has been cited by voters in multiple polls this year as the issue they care most about.

After years of owning the health-care issue in the aftermath of the ACA’s nearly immediate unpopularity, Republicans largely ceded it to Democrats after their failed attempt to repeal the law last year.

But as the GOP shifted its focus to tax cuts — which have not gained traction among voters — Democrats built an entire midterm campaign strategy around preserving the law’s most popular provision.

The actions of Republicans, including the president, before this election year have not matched their rhetoric over the past few weeks.

For more than eight years, their greatest and most unifying party rallying cry has been repealing Obamacare. When the House passed legislation to do just that, Trump invited Republican members to the White House and celebrated with them in the Rose Garden. (An early sign of Trump’s current positioning came only weeks later, when the backlash from the public intensified and he called the House measure “mean.”)

After Sen. John McCain (R-Ariz.) voted “no” on repealing the ACA, effectively killing the GOP’s chances to make good on a years-long promise, Trump began deriding him at rallies, a rhetorical device he has continued to use after McCain’s death.

Trump also has bragged repeatedly about his administration’s many steps to undermine the law and water down protections, even as his administration has refused to defend any part of the law against the lawsuit filed by Republican attorneys general.

In the Senate, meanwhile, Majority Leader Mitch McConnell (R-Ky.) reasserted this week his desire to repeal and replace the health-care measure. But in keeping with the new message strategy, he added that “there’s nobody in the Senate that I’m familiar with who is not in favor of coverage of preexisting conditions.”

“I think the big issue is the brazenness [with] which this mantle is being put on to say this is something they’ve always supported,” said Sabrina Corlette, professor of health policy at Georgetown University.

Most health-policy experts say the Republican position is contradictory because without a replacement plan in place, people with past or existing illnesses would lose the protections they have now.

How to handle preexisting conditions was a major flash point in the debate last year. The bills voted on did not eliminate protections for preexisting conditions, but they did weaken them considerably by giving power to the states to waive certain requirements for insurers — a demand from the GOP’s most conservative members.

“The irony is that what allowed the House to pass [the repeal bill] was a proposal to weaken protections for preexisting conditions. This was not an obscure part of the debate,” said Larry Levitt, senior vice president for health reform at the Kaiser Family Foundation.

A Kaiser tracking poll released Thursday found that more than 70 percent of voters say health care is a “very important” factor in whom they vote for, and 30 percent said it was the “most important” issue.

Recent polls, including a Washington Post-ABC News survey this week, show that voters who list health care as a priority are more likely to support Democratic candidates, suggesting that the Democrats’ campaign strategy to paint Republicans as the villain on health care has been working.

In response to the shifting views, several congressional Republicans have offered new legislation promising to maintain protections for preexisting conditions if the ACA is struck down by the courts.

In August, 10 Senate Republicans, including Dean Heller of Nevada, one of the most vulnerable GOP senators facing a reelection challenge next month, sponsored such a bill, but health-policy experts have pointed to loopholes in the measure. It requires insurers to sell plans to individuals with certain conditions, but insurers could exclude coverage for services associated with those conditions. For example, a person with cancer could not be denied coverage, but insurers would not be required to cover that patient’s cancer treatments.

Sen. Thom Tillis (R-N.C.), the bill’s sponsor, has defended it by saying it was never intended to be “comprehensive” or the “totality of Congress’s answer” to the court challenge.

On the House side, Rep. Steve Knight (R-Calif.), who is trying to fend off a difficult challenge in California’s 25th Congressional District, introduced a bill in late September with tighter protections. And two other GOP congressmen locked in tight races, Reps. David Young (Iowa) and Pete Sessions (Tex.) each introduced nonbinding resolutions expressing a desire to preserve protections for preexisting conditions.

As the political narrative in recent weeks has shifted to the GOP’s sudden commitment to protections for preexisting conditions, Democrats are at risk of losing some of their momentum on the issue. Responding to a tweet about Republicans’ now embracing protections for preexisting conditions, Sen. Brian Schatz (D-Hawaii) replied: “THEY ARE NOT EMBRACING IT. Sorry for yelling.”

But Levitt of the Kaiser foundation sees a silver lining to Democrats’ forcing Republicans to take a public and pronounced stand on preexisting conditions.

“It’s quite dramatic to have this bipartisan consensus on preexisting conditions,” Levitt said. “It might be that the most enduring legacy of the ACA is the dramatic shift in belief that preexisting conditions should have a guarantee of coverage.”

Paulina Firozi contributed to this story.