The grocery giants Albertsons and Kroger are in talks to combine in a deal that would be one of the industry’s largest in years, creating a colossal food retailer aimed at taking on Walmart, four people with knowledge of the plans said.

The deal could be announced as soon as Friday, said the people, who requested anonymity because the talks were confidential.

A merger would combine the two largest grocery chains in the United States, which together generate annual revenue of $209 billion and have more than 5,000 stores across the country. That would put them more in the running against big-box operators like Walmart, Amazon and Costco. Last year, groceries made up $218 billion, or 55 percent, of Walmart’s U.S. sales.

A deal would almost certainly invite antitrust scrutiny from regulators, who have been zeroing in on the potential power of large companies to affect prices as inflation drives up the cost of food and other commodities. Kroger and Albertsons would most likely include a proposal to address any antitrust concerns by selling off certain stores. Lina Khan, who leads the Federal Trade Commission, which is likely to review any deal, has expressed skepticism that such solutions are sufficient.