Six months after the U.S. Department of Justice and attorneys general from eight states and the District of Columbia sued to stop the merger of insurance giants Aetna and Humana, the federal judge in the case has blocked the deal from moving forward.

The DOJ had argued that the combination of these two companies would “substantially” harm competition in the marketplace for both individual health insurance plans purchased through public exchanges, and for Medicare Advantage insurance plans.

The Medicare Advantage coverage posed the larger antitrust concern, as investigators for the government identified 364 counties in 21 states where they believe a combined Aetna/Humana would have market share levels for this insurance above what is generally considered to be unlawful.

The insurers countered that the DOJ was neglecting to account for traditional Medicare plans provided through state agencies. When combining Original Medicare and Medicare Advantage, argued the insurance companies, there are sufficient competition in the marketplace.

With regard to issues about the public exchanges, the DOJ concluded that, post-merger, Aetna and Humana would hold too much market share in 17 counties in three different states. The insurance companies claimed that is a non-problem, as Aetna is not offering plans in these exchanges for 2017.

In the end, D.C. District Court Judge John Bates sided with the DOJ and the states, concluding in his 158-page opinion [PDF] that the proposed merger is “likely to substantially lessen competition in Medicare Advantage in all 364 complaint counties,” and that the government was correct to not consider Original Medicare as a direct competitor to Advantage.

Health insurance exchanges in three Florida counties would also be adversely affected. The judge also notes that Aetna withdrew some selling insurance in the other counties mentioned in the DOJ complaint to “evade judicial scrutiny of the merger,” and was therefore not an indicator that the company wouldn’t simply re-enter those markets after the merger.

Aetna says it is weighing an appeal.

Today’s ruling was applauded by some consumer advocates, including our colleagues at Consumers Union, who had previously testified before the Senate Judiciary Committee and the California Department of Insurance about the potential negative impact of this merger.

“The Justice Department laid out strong proof at trial that the merger of these two health insurance giants would have seriously harmed consumers across the country, especially seniors using Medicare Advantage, leaving them with fewer choices, higher costs, and ultimately, with inferior coverage,” said George Slover, senior policy counsel at CU. “This problematic deal simply couldn’t be fixed, and we are pleased the court has agreed.”