President Trump gives a thumbs up as he departs the White House on Thursday, Oct. 18, 2018. (Kevin Lamarque/Reuters)

President Trump expressed support Thursday for one of the most popular provisions of an Obama-era law protecting people with preexisting conditions, even as he has repeatedly promised to scrap the law and his administration is waging a legal fight to overturn it.

“All Republicans support people with pre-existing conditions, and if they don’t, they will after I speak to them,” Trump said in a tweet Thursday afternoon. “I am in total support. Also, Democrats will destroy your Medicare, and I will keep it healthy and well!”

Trump has repeatedly promised to repeal the Affordable Care Act, also known as Obamacare, and frequently bemoans the failure of a Republican-led repeal effort in the Senate last year. The measure’s defeat was sealed by Sen. John McCain (R-Ariz.), whose “no” vote Trump has frequently blasted on the campaign trail — even while the senator was battling brain cancer. McCain died in August.

The Trump administration has also joined a lawsuit against the 2010 health-care law filed by 20 Republican attorneys general.

A recent Kaiser Family Foundation poll showed that 75 percent of Americans believe it is “very important” that Obamacare’s protections for those with preexisting conditions remain intact.

Republican candidates have increasingly sought to assure voters that they support those protections despite a years-long GOP effort to repeal the 2010 law, a partial 16-day government shutdown in 2013 to try to defund it and dozens of House votes to revamp or scrap the law.

Last year, Trump celebrated at the White House with dozens of Republicans after the House passed a bill to undermine the law. The legislation stalled in the Senate.

On Wednesday, Senate Majority Leader Mitch McConnell (R-Ky.) said in an interview with Reuters that Republicans may take another shot at repealing the Affordable Care Act after the November midterms.

He called his party’s failure to repeal the law despite years of pledging to do so “the one disappointment of this Congress from a Republican point of view.”

Tracy Jan contributed to this report.