A HealthCare.gov Web page. (AP Photo/Charlie Riedel)

The country was almost out of this Obamacare mess. After years of political strife and Obama administration management failures, after an exacting legal review that included two high-profile Supreme Court cases, after broken Web sites were improved, after some people lost plans the liked, after others gained plans they would never have been able to afford, after millions of people enrolled, and after the rate of uninsured Americans dropped, the Affordable Care Act finally seemed to be finding its footing, and there were indications that the nation would finally move on.

But on Tuesday two judges on the U.S. Court of Appeals for the District of Columbia Circuit decided that they would push the country back into Obamacare-related turmoil, tearing apart a crucial piece of the policy based on an interpretation of a few of the act’s thousands of lines. If their ruling holds, Americans in 36 states will lose access to the tax credits that make their health insurance coverage affordable — tax credits that have dropped their premiums by an average of 76 percent.

That result, so obviously at odds with what Congress intended, would be warranted if the text of the law were so unambiguous that the D.C. Circuit had no choice but to rip the system apart just as it was establishing itself. But the text does not demand that result.

Here is the problem: Only a handful of states and the District of Columbia created their own health-care marketplaces. Most rely on the HealthCare.gov, a hub of state-specific marketplaces the federal government created for states that lack their own. But the D.C. Circuit’s reading of one provision of the law indicates that only people buying insurance in state-run marketplaces are eligible for tax credits. Under that interpretation, the 5 million people currently taking tax credits — and millions more who would sign up in years to come — in HealthCare.gov states may lose their government assistance. They would have to pay sharply higher premiums, go without insurance or hope to find coverage outside the system that would work for them — if any such coverage product exists.

The D.C. Circuit’s judges acknowledged the stakes, claiming that they ruled “with reluctance” and that there could be no other reading of the law’s text. Yet, of the several courts that have considered this issue, the D.C. Circuit is the only one to reach that conclusion. In fact, within hours of the D.C. Circuit’s ruling, a unanimous panel on the Court of Appeals for the Fourth Circuit found the opposite: that the law’s language was ambiguous. Read in reference to other passages of the law, Congress seems to have intended for the federal government to act on behalf of each state that failed to establish its own marketplace. Some of the law’s reporting requirements, meanwhile, demand that all marketplaces — federal or otherwise — report information back to the IRS that the agency uses to calculate people’s tax credits. Why demand that information, if federal marketplace customers can’t get tax credits?

There is, in other words, enough ambiguity in the text to justify a broader legal analysis under long-established precedent, one in which judges give the Obama administration, which looked to the law’s purpose and structure in interpreting the text, deference in sorting out the meaning of the language. At that point, the devastating effects the D.C. Circuit’s ruling would have on the ACA’s structure indicate that the most reasonable conclusion is the  administration’s: Congress could not have intended to offer tax credits only to people in state-run marketplaces. “There is no question,” the Fourth Circuit argued, “that the act was intended as a major overhaul of the nation’s entire health insurance market. The Supreme Court has recognized the broad policy goals of the act: ‘to increase the number of Americans covered by health insurance and decrease the cost of health care.’” Yet the D.C. Circuit’s interpretation would leave millions of low- and middle-income people out of the system.

The truncated system that would be left in HealthCare.gov states, meanwhile, would crash. Too few people would be able to buy insurance in the marketplace, which would make it impossible to spread health-care risk across a wide group of people in each state. Because the law forbids insurance companies from denying coverage based on pre-existing medical conditions, insurer costs — and premiums — would skyrocket without wide risk-sharing. States that did not respond to this policy mess by creating their own marketplaces would see the health insurance “death spiral” that experts have warned about.

The essential reality is clear: Congress intended to create a near-universal health-care coverage system. Democratic lawmakers did not approve language that so clearly operates in the other direction that judges must now undo the very results Congress sought to effect.

Stephen Stromberg is a Post editorial writer. He specializes in domestic policy, including energy, the environment, legal affairs and public health.