Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

Obamacare got taken for a roller-coaster ride on Tuesday when two different appeals courts took completely different takes on the latest challenges to the law.

In a potentially lethal blow, a federal appeals court in Washington, D.C. ruled that the federal government may not subsidize health insurance plans for people in 34 states that decided not to set up their own marketplaces under the law.

But the 4th U.S. Circuit Court of Appeals in Richmond took the opposite point of view, saying the subsidies are legal.

The law clearly says that states are to set up the exchanges. But most states opted not to, and the federal government took over in those states. The DC court ruled that the federal government may not pay subsidies for insurance plans in those states.

"We reach this conclusion, frankly, with reluctance," District of Columbia Appeals Court judge Thomas Griffith writes in the 2-1 ruling in the first case, called Halbig, which the federal government will appeal.

Both appeals courts agree on what is going on -- people challenging the law don't want to be forced to buy health insurance.

"What they may not do is rely on our help to deny to millions of Americans desperately-needed health insurance through a tortured, nonsensical construction of a federal statute whose manifest purpose, as revealed by the wholeness and coherence of its text and structure, could not be more clear," 4th Circuit Senior Circuit Judge Andre Davis wrote in an opinion concurring with the Richmond panel's ruling upholding the law.

The decisions change nothing right away. "People getting premium tax credits should know that nothing has changed. Tax credits remain available," said Department of Justice spokeswoman Emily Pierce. Years of more court action likely lie ahead before the matter is settled.

“You don’t need a fancy legal degree to understand that Congress intended for every eligible American to have access to tax credits that would lower their health care costs, regardless of whether it was state officials or federal officials who were running the marketplace,” White House spokesman Josh Earnest said. “I think that was a pretty clear intent of the congressional law.”

The subsidies are at the heart of the 2010 Affordable Care Act. The federal government pays up to 100 percent of the premiums for certain insurance plans for people with low incomes. It does this via tax credits given when people file their income taxes.

"We reach this conclusion, frankly, with reluctance."

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

"It is ... clear that widely available tax credits are essential to fulfilling the Act’s primary goals and that Congress was aware of their importance when drafting the bill," the three-judge Richmond panel ruled.

"With only sixteen state-run Exchanges currently in place, the economic framework supporting the Act would crumble if the credits were unavailable on federal Exchanges."

The Halbig suit was brought by a group of small business owners who argued the Internal Revenue Service was using the premiums as a way to improperly enforce the law's mandates that individuals have health insurance and that most employers provide it.

“Today’s decision reaffirms that the administration cannot rewrite the health law that was passed and it stops the Internal Revenue Service from doing the same," said Andrew Kloster of the conservative Heritage Foundation. "The statute is clear in the Affordable Care Act that the subsidies are to be directed only to states that elected to set up insurance exchanges.”

One judge on the three-judge DC panel, Harry Edwards, dissented. "This case is about Appellants’ not-so-veiled attempt to gut the Patient Protection and Affordable Care Act," he wrote.

The administration says 6.7 million people are getting tax credits to pay their premiums for insurance policies on the exchanges. Of these, 70 percent, or 4.7 million, are using a federal exchange.

The administration will now ask for the full 11-member appeals court to rule, something called an "en banc" review.

The Center for American Progress, a left-leaning think-tank that favors the Obama administration, says the ruling is unlikely to hold up. “Today’s decision against the ACA and in favor of the conservatives would not have any instant impact on how the law functions or the premium tax credits that people are getting pending the ‘en banc’ review or that of the Supreme Court,” the center said in a statement.

“Given the makeup of the full D.C. Circuit Court and the weakness of the conservative argument, it is very unlikely a negative decision from the three-judge panel would stand.”

“The politics will be ugly, I think, at the end of the day."

Joel Ario, a managing director at Manatt Health Solutions who helped set up the exchanges when he worked at the Health and Human Services Department, said governors of states that opted out of building their own exchanges would be under pressure to do so now. Otherwise, “there would be a lot of unnecessary pain in the states,” Ario told NBC News.

“The politics will be ugly, I think, at the end of the day,” he said.

The ruling appeared to invigorate Republican opponents of the law.

"Today's ruling is ... further proof that President Obama's health care law is completely unworkable. It cannot be fixed," House Speaker John Boehner said in a statement.

"The American people recognize that ObamaCare is hurting our economy and making it harder for small businesses to hire, and that's why Republicans remain committed to repealing the law and replacing it with solutions that will lower health care costs and protect American jobs," Boehner said.

The Affordable Care Act has been controversial from the start. Congress passed it without a single Republican vote and opponents have filed hundreds of court challenges.

It's the third major challenge likely to make it to the Supreme Court; in 2012, the Supreme Court ruled that the law was constitutional but said states did not have to expand Medicaid to more people. Several governors immediately said they would not expand their Medicaid programs, a giant blow to Obama administration hopes.

Just last month, in another loss for the administration, the Supreme Court ruled in the so-called Hobby Lobby decision that some employers could opt out of the law's requirement that health insurers pay for contraception.

The law aims to get more people covered by health insurance and surveys show it's done that. Gallup showed that 10 million more people have health insurance now than last year and says it's driven the percentage of uninsured Americans from a peak of 18 percent last year to 15 percent.