A judge ruled Friday evening that Obamacare is unconstitutional, putting the future of the federal healthcare law in jeopardy.

The decision, issued by U.S. District Judge Reed O’Connor in the Northern District of Texas — a George W. Bush appointee — is likely to face an appeal to the Fifth Circuit. Obamacare will remain in place pending appeal.

The suit in the case, Texas v. Azar, was brought by 20 Republican state officials, who have asked that all of Obamacare be thrown out as a consequence of the new tax law, which zeroed out a penalty on the uninsured, known as the "individual mandate." The officials argued that the penalty was central to making the rest of the law work, and that without it, the rest should crumble.

O'Connor appeared to sympathize with this argument in his opinion. He explained that he believed Congress would not have enacted Obamacare in the first place, with its various rules and taxes, without the mandate, and that the regulatory framework was intended to work together.

"Congress stated many times unequivocally — through enacted text signed by the president — that the individual mandate is 'essential' to the ACA," he wrote of the Affordable Care Act, the formal name for Obamacare. "And this essentiality, the ACA’s text makes clear, means the mandate must work 'together with the other provisions' for the Act to function as intended."

O'Connor was talking about the Obama administration's argument that the mandate could not be severed from the rest of the law in a 2012 Supreme Court case. In his opinion, he elaborated on the different ways that Obamacare had been challenged in court and in Congress.

"It is like watching a slow game of Jenga, each party poking at a different provision to see if the ACA falls," O'Connor wrote.

The decision came just a day ahead of when the open enrollment for Obamacare's marketplaces are set to close across most of the U.S. Enrollment in these marketplaces, or exchanges, has been lagging, with some critics arguing that the zeroing out of the fine is partially to blame. The marketplaces apply to people who don't get healthcare coverage through work or a government program. Roughly 10 million people buy plans on the exchanges and another 7 million have plans outside of them that must still abide by Obamacare's rules under law.

Senate Minority Leader Chuck Schumer said that if the ruling is upheld in the higher courts then it will be a "disaster for tens of millions of American families, especially for people with pre-existing conditions."

“The ruling seems to be based on faulty legal reasoning and hopefully it will be overturned," he said.

Trump's Department of Justice had joined the lawsuit but asked specifically that the rules on pre-existing illnesses be struck down. These rules prohibit health insurance companies from turning away sick customers, from charging them more for their illness, or from refusing to cover medical services associated with managing their condition.

Justice Department attorney Brett Schumate had asked that any changes to Obamacare by the court be delayed until 2020, given that the rates for next year are already set.

The case was argued Sept. 5. Its defendants, including several Democratic state officials, said that it was never the intent of Congress to undo other parts of the law.

President Trump has pledged that a Republican replacement plan to Obamacare would protect people with pre-existing conditions, a plan he asked Congress to "get it done" late Friday.

Republican replacement plans in Congress have contained similar language as Obamacare for protecting sick people but omit other portions to make coverage affordable to them.

One of Trump's top health chiefs, Centers for Medicare and Medicaid Services Administrator Seema Verma, recently said that the administration had devised a backup plan in case the law is struck down, but wouldn't share at the time what it was.

Political attacks on healthcare featured heavily during the midterm elections, and Nancy Pelosi, the favored House speaker for the next Congress, credited the party's platform healthcare for the Democratic victory in the House.

