This story has been updated.

A federal judge blocked the $54 billion merger between health insurance giants Anthem and Cigna on Wednesday, saying the deal would increase prices and reduce competition. It is the second recent court decision to uphold the Justice Department's opposition to deals that would have radically reshaped the health insurance landscape, consolidating the five largest insurers in the United States into three companies.

“The evidence has also shown that the merger is likely to result in higher prices, and that it will have other anticompetitive effects: it will eliminate the two firms’ vigorous competition against each other for national accounts, reduce the number of national carriers available to respond to solicitations in the future, and diminish the prospects for innovation in the market,” U.S. District Judge Amy Berman Jackson wrote in a 12-page order.

The ruling follows a similar decision by a different judge to block the proposed $37 billion merger between Aetna and Humana last month. The Justice Department sued last summer to stop both mergers, and the judge's rulings in both cases are a clear affirmation of antitrust officials' argument that the deals would harm competition.

Acting assistant attorney general Brent Snyder of the Justice Department’s antitrust division called the decision a victory for consumers.

“This merger would have stifled competition, harming consumers by increasing health insurance prices and slowing innovation aimed at lowering the costs of healthcare,” Snyder said in a statement.

Anthem's chief executive, Joseph R. Swedish, said in a statement that the company would “continue to work aggressively to complete the transaction” and would file an appeal.

“Anthem is significantly disappointed by the decision, as combining Anthem and Cigna would positively impact the health and well-being of millions of Americans — saving them more than $2 billion in medical costs annually,” Swedish said.

Cigna's response, however, was less clear. Cigna is owed a $1.85 billion termination fee from Anthem if the deal falls apart because of regulatory scrutiny, according to the merger agreement.

“Cigna intends to carefully review the opinion and evaluate its options in accordance with the merger agreement,” Cigna's statement said.

At issue in the judge's decision was the effect the merger would have had on competition for national accounts — employers buying health coverage for more than 5,000 employees. The judge said that with only four companies competing for that business, the merger would reduce competition for national accounts in 14 states. It would also harm competition in the market for commercial insurance for large groups — companies with more than 100 employees — in Richmond. The judge also questioned the proposed savings that would come from the deal, pointing out that companies who wished to access Anthem's lower provider rates could simply sign up for an Anthem plan, instead of waiting for the companies to merge.

Ana Gupte, an analyst at Leerink Partners, said that the judge's decision is not a surprise. She said it's possible that Anthem's decision to appeal is a stalling tactic.

“They are on the hook to pay $1.85 billion to Cigna; this gives them time to push that out and rethink that strategy,” Gupte said.

More broadly, she said there could be more deals coming, big and small. The possibility of a looser regulatory regime at the Centers for Medicare and Medicaid Services under the Trump administration and Republican Congress is expected to benefit the Medicare Advantage market, the business of selling private Medicare plans. She thinks that could make Humana, which is strong in the Medicare Advantage market, an attractive takeover target for Cigna.

Meanwhile, health-care providers — including hospitals and doctors — praised the decision.

“Today’s ruling by the D.C. District Court confirms that the Department of Justice made the right decision in challenging the Anthem-Cigna mega-merger. As a result, millions of Americans have been protected from higher insurance costs, fewer choices of providers and less innovation in health care delivery,” said Rick Pollack, president of the American Hospital Association, in a statement.

Andrew W. Gurman, president of the American Medical Association, said that the “significant absence of health insurer competition in most markets is detrimental to patients” and said his organization would continue to be focused on this issue.