WASHINGTON, DC - MAY 23: U.S. President Barack Obama announces his nomination of San Antonio, Texas, Mayor Julian Castro as his next choice to lead the Department of Housing and Urban Development May 23, 2014 in Washington, DC. Castro would be replacing current HUD Secretary Shaun Donovan who, if approved by the Senate, will head the Office of Management and Budget. (Photo by Chip Somodevilla/Getty Images)National Journal

A federal appeals court said Tuesday that Obamacare's insurance subsidies are all perfectly legal — just hours after a different court said the same subsidies were illegal.

A three-judge panel of the 4th Circuit Court of Appeals rejected a lawsuit that aimed to block the law's subsidies in more than half the country. The challengers said the subsidies, which help people cover the cost of their premiums, should only be available in states that set up their own insurance exchanges — not in the 36 states that turned to the federal government to run their marketplaces.

They cited a section of the law that refers to subsidies flowing through "an exchange established by the state," saying that provision foreclosed subsidies in federally run marketplaces.

The Justice Department says that's too narrow of a reading.

The 4th Circuit panel said the statute itself was unclear. It allowed the IRS to continue providing financial assistance in all 50 states, saying the agency's interpretation of the law was entitled to deference in the courts.

Just hours earlier, a three-judge panel of the D.C. Circuit Court of Appeals came to the opposite conclusion, ruling in a 2-1 decision that the IRS broke the law by making subsidies available through federally run exchanges.

The Justice Department will appeal that ruling to the full D.C. Circuit.

We want to hear what you think about this article. Submit a letter to the editor or write to letters@theatlantic.com.