An insurance agent from Sunshine Life and Health Advisors, speaks with a customer as she shops for insurance under the Affordable Care Act at a store setup in the Mall of Americas on November 1, 2017 in Miami, Florida.

A federal judge in Texas ruled on Friday the Affordable Care Act unconstitutional, potentially threatening health-care coverage for millions of Americans and setting up a new legal showdown over former President Barack Obama's signature policy initiative.

U.S. District Court Judge Reed O'Connor of Texas issued the decision, declaring that key portions of the legislation were inconsistent with the Constitution. O'Connor's ruling argued that the health-care law can not stand on its own since Congress last December repealed the individual mandate, which imposed a tax penalty on consumers who went uninsured.

The mandate, which remains in effect for 2018, was a key part of ACA legislation, otherwise known as Obamacare. The mandate is the greater of $695 person per adult, or 2.5 percent of household income.

The lawsuit was backed by the Trump administration, and is likely to be appealed — which could mean the legislation will heard anew by the Supreme Court, which upheld Obamacare in a narrowly divided 2012 ruling.

Medicare & Medicaid Services Administrator Seema Verma told reporters earlier this month that CMS has a plan to protect pre-existing conditions if the law is struck down.

A CMS spokesperson late Friday told CNBC, "The recent federal court decision is still moving through the courts, and the exchanges are still open for business and we will continue with open enrollment. There is no impact to current coverage or coverage in a 2019 plan."

The ruling came hours before the ACA's final open enrollment day to get health coverage next year. Sign-ups on the federal health insurance marketplace have been low this season, tumbling 11.7 percent from the same time last year, according to the latest figures from Centers for Medicare and Medicaid Services.

While President Donald Trump was previously unable to repeal Obamacare, he was able to dismantle key parts of it that several health policy researchers are blaming for much of the drop in enrollment this year. He applauded the judge's ruling in a tweet late Friday.

White House Press Secretary Sarah Huckabee Sanders released a statement praising the ruling. "Obamacare has been struck down by a highly respected judge. The judge's decision vindicates President Trump's position that Obamacare is unconstitutional."

Democratic California Attorney General Xavier Becerra, who led a group states in intervening to defend Obamacare, called the decision "an assault on 133 million Americans with preexisting conditions, on the 20 million Americans who rely on the ACA's consumer protections for healthcare."

The American Medical Association called the ruling "an unfortunate step backward for our health system" and warned the decision could "destabilize health insurance coverage."

"No one wants to go back to the days of 20 percent of the population uninsured and fewer patient protections, but this decision will move us in that direction," AMA president Barbara L. McAneny said in a statement.

Larry Levitt, senior vice president for Health Reform at the Kaiser Family Foundation said the ACA is still in effect, "so this court case should certainly not discourage people from signing up for insurance."

Andy Slavitt, a former CMS administrator under the Obama administration, said the ruling is a political statement, noting that the ruling does not include an injunction. "This feels like picking a scab the American public wants healed," Slavitt said.

"The most important thing is nothing changes for consumers," in the short term he said. "This (case) is to going to go on and likely drag on for a couple of years."

--CNBC's Bertha Coombs contributed to this report.