FILE - The exterior of Kroger's fulfillment center is shown on July 27, 2022 in Dallas, Tex. (Rebecca Slezak/The Dallas Morning News via AP, File)

A federal judge has temporarily halted a proposed merger between supermarket giants Kroger and Albertsons, an action that could scuttle the deal.

U.S. District Court Judge Adrienne Nelson issued the ruling Tuesday after holding a three-week hearing in Portland, Oregon.

Kroger and Albertsons in 2022 proposed what would be the largest grocery store merger in U.S. history. But the Federal Trade Commission sued earlier this year, asking Nelson to block the $24.6 billion deal until an in-house administrative judge at the FTC could consider the merger’s implications.

Nelson agreed to pause the merger.

“Any harms defendants experience as a result of the injunction do not overcome the strong public interest in the enforcement of antitrust law, especially given the difficulty in disentangling a premature merger,” she wrote in her opinion.

Colorado Attorney General Phil Weiser, who has helped lead a multi-state effort to halt the merger, said the move was a victory for consumers.

“Today’s ruling is a victory for consumers, workers, and farmers,” Weiser said in a statement. “All along, we have made the case that the Kroger/Albertsons merger is illegal and bad for Colorado. It is bad for grocery shoppers who are already feeling pinched at the checkout counter. It’s bad for workers and their job security and benefits. And it’s bad for farmers and other suppliers because there would be fewer local food options available at the store.”

Weiser said Colorado has filed its own case inside Colorado in an additional effort to block the merger.

“We wait for a ruling in our case, and we are optimistic that this illegal merger will be permanently blocked,”  he said.

Federal regulators argue that combining the two chains would be bad for consumers and workers by eliminating competition. The companies say a merger would help them better compete with big retailers like Walmart, Costco and Amazon.

The case may now move to the FTC, although Kroger and Albertsons have asked a different federal judge to block the in-house proceedings. Colorado and Washington are also trying to halt the merger in ongoing state trials. The judge in Washington was expected to release his opinion later Tuesday.

The FTC argued that Kroger and Albertsons currently compete in 22 states, closely matching each other on price, quality, private label products and services like store pickup. A merger would eliminate that competition and raise prices for already struggling consumers, the government said. The FTC also said the merger would hurt workers since Kroger and Albertsons would no longer compete to hire them.

But Kroger and Albertsons argued their merger would preserve consumer choice by allowing them to better compete against its growing rivals. In its testimony, Albertsons warned Nelson that it might have to lay off workers, close stores and even exit some markets if the merger weren’t allowed to proceed.

Under the merger agreement, Kroger and Albertsons would sell 579 stores in places where their locations overlap to C&S Wholesale Grocers, a New Hampshire-based supplier to independent supermarkets that also owns the Grand Union and Piggly Wiggly store brands.

The FTC argued that C&S is ill-prepared to take on the stores and may want the option to sell or close them. But Kroger and Albertsons said C&S has the experience and national scale to handle the divestiture.

Kroger, based in Cincinnati, Ohio, operates 2,800 stores in 35 states, including brands like Ralphs, Smith’s and Harris Teeter. Albertsons, based in Boise, Idaho, operates 2,273 stores in 34 states, including brands like Safeway, Jewel Osco and Shaw’s. Together, the companies employ around 710,000 people.