But the deal came under sharp criticism from consumer advocates and government officials who argued that the private market was already concentrated: Individuals would suffer from a lack of choice and competition in certain markets. UnitedHealth, Humana and Aetna were the three largest players in the Medicare Advantage market, according to an analysis by the Kaiser Family Foundation last year.

In his ruling, the judge, John D. Bates of the United States District Court for the District of Columbia, said the court “mostly agrees” with the Justice Department’s argument that the deal would lessen competition for Medicare Advantage plans as well as individual health insurance sold in state marketplaces.

Judge Bates rejected the companies’ rebuttal, saying that government regulation would be unable to prevent the combined entity from “raising prices or reducing benefits.” He said that neither new competitors nor divestitures would be enough to address the concentration that would result from the merger.

The insurers had argued that the merger would allow them to become more efficient, passing those savings on to consumers. But the judge said he did not think the merger would benefit people buying policies, especially in those markets where the combination of the companies would have a large share of the business.

“The court is unpersuaded that the efficiencies generated by the merger will be sufficient to mitigate the anticompetitive effects for consumers in the challenged markets,” he wrote.

Over the last few years, the Obama administration became more aggressive in blocking deals, especially in health care. The government has blocked mergers among large hospital systems and contributed to dismantling the $152 billion deal between Pfizer and Allergan.

Monday’s ruling came six months after the Justice Department sued to block both the Aetna and the Cigna deals. Both were seen as unlikely to succeed, although the merger between Cigna and Anthem was seen as even less likely to be approved because those two companies have more overlap nationally and have been unable to present a unified front.