WASHINGTON — While President Donald Trump hailed as "great news for America" a federal judge's ruling striking down aspects of the Affordable Care Act, the White House rushed to assure Americans the program will remain in place while the lawsuit is appealed.

On Twitter, Trump labeled the ACA an "UNCONSTITUTIONAL disaster!" and called on Republican and Democratic congressional leaders to pass a "STRONG law that provides GREAT healthcare."

In a separate statement late Friday, the White House said: “We expect this ruling will be appealed to the Supreme Court. Pending the appeal process, the law remains in place.”

With the ruling having no immediate effect, consumers who buy insurance through federal or state marketplaces still can purchase 2019 coverage through Saturday.

If the latest ruling is upheld after the appeal process, however, subsidies that people collect to buy health coverage would no longer be available. Medicaid, which has extended insurance coverage to millions of low income and working-class Americans, could also be in jeopardy.

The lawsuit was brought by 20 Republican-led states. After Trump ordered the Justice Department to stop defending the health care law — President Barack's Obama signature legislative achievement, which provides health care coverage to millions — a coalition of ACA-supporting states took up the defense.

The Justice Department had urged the judge not to rule in the midst of the health law's open enrollment season or risk a chaotic situation. The federal enrollment period runs from Nov. 1 through Saturday, and into January in some states.

Rep. Nancy Pelosi, who is virtually assured of becoming House Speaker in January, said it was "absurd" that the judge declared portions of the health law unconstitutional. She vowed to intervene in the appeals process when Democrats take control of the House next month.

"Republicans are fully responsible for this cruel decision and for the fear they have struck into millions of families across America who are now in danger of losing their health coverage," she said in a statement.

Attorney General Ken Paxton of Texas, who initiated the lawsuit, applauded the decision, saying in a statement: “Today’s ruling enjoining Obamacare halts an unconstitutional exertion of federal power over the American health care system.”

In a signal of the shifting public opinion in favor of the 2010 law, Trump stressed in his latest tweet that any new program should include one of the most popular aspects of Obamacare, a ban on health insurers denying coverage to people based on pre-existing conditions.

Many GOP candidates took care to champion the pre-existing conditions aspect of the law during the midterm elections.

In his 55-page ruling, U.S. District Court Judge Reed O’Connor in the Northern District of Texas agreed with a coalition of Republicans that it was unconstitutional to mandate individuals buy health insurance or be taxed for not complying. The GOP tax-cut bill Congress passed last year, he said, knocked the constitutional foundation from under Obamacare by eliminating a penalty for not having coverage.

"The court today finds the individual mandate is no longer fairly readable as an exercise of Congress's tax power and continues to be unsustainable under Congress's interstate commerce power," O’Connor, a George W. Bush appointee, wrote. "The court therefore finds the individual mandate, unmoored from a tax, is unconstitutional."

The ruling likely will be appealed by California and other states to the U.S. Court of Appeals for the 5th Circuit, which is dominated 11-5 by Republican presidents' nominees.

The expected lengthy court fight between Republican and Democratic state officials over the ruling likely would end up at the Supreme Court, which has twice voted to uphold other challenges to the ACA.

In 2012, the court upheld the law's mandate that individuals buy insurance as a tax, and in 2015 it upheld tax credits for low-income recipients in federal as well as state insurance exchanges.

If the Texas decision is upheld "it would throw the individual insurance market and the whole health care system into complete chaos,” said Larry Levitt, a senior vice president of the Kaiser Family Foundation for health care policy, in a Friday Twitter post.

“But," he added, "the case still has a long legal road to travel before that’s an immediate threat.”

The foundation, a nonpartisan research organization, has estimated that 52 million adults from 18 to 64, or 27 percent of that age group, would be denied coverage under the practices that were in effect in most states before the ACA was passed.

The latest challenge stems from Congress' elimination of the penalty for not purchasing health insurance, part of the $1.5 trillion tax overhaul approved last December. The penalty will disappear in 2019 under the tax law.

Texas and 19 other states argued that the entire law had been ruled constitutional based on that penalty. In a previous ruling upholding the ACA, the Supreme Court compared the penalty to a tax.

The Trump administration sided largely with those states but argued that only some provisions of the law should fall if the individual mandate were struck down. That would include coverage for pre-existing conditions. But a group of Republican senators are seeking to preserve at least part of that coverage if the law is struck down.

A central question in the case is whether Congress intended for the individual mandate and coverage for pre-existing conditions to be inseparable, as the Obama administration argued in 2012. Five years later, Congress specified that eliminating the penalty should not jeopardize the rest of the law.

The annual penalty for those who refuse to get health insurance is $695 or 2.5 percent of income, whichever is greater.

Contributing: Christal Hayes in Washington