Albertsons wants to scoop up Rite Aid.
The deal announced Tuesday will create a new company with about $83 billion in annual sales and 4,900 locations across the country. Albertsons and Rite Aid didn't disclose the value of the agreement.
Albertsons is privately held and Rite Aid is a public company. It's not yet clear what the name of the combined company will be.
The move will allow Albertsons to go public as a "fully integrated one-stop-shop for our customers' food, health and wellness needs," Albertsons' CEO Bob Miller said in a statement.
Albertsons hopes acquiring Rite Aid will help it grow its customer base and keep pace with Amazon and Walmart as the two giants expand further into the grocery business. The company bought Safeway grocery stores in 2014 and meal kit service Plated in 2016.
Both chains are adjusting to consolidation in the pharmacy and supermarket industries.
CVS agreed to buy health insurer Aetna in December for $69 billion. Jeff Bezos, Warren Buffett and Jaime Dimon announced last month that they were joining together to address health care costs.
Related: Jeff Bezos and his two friends just spooked health care stocks
Walgreens wanted to buy up all of Rite Aid in 2015, but federal regulators nixed that agreement on antitrust grounds. In September, the two companies announced a scaled back version for nearly 2,000 of Rite Aid's stores. That left Rite Aid with around 2,600 stores.
Albertsons has 2,220 grocery stores, including Vons, Shaw's and Acme. Its pharmacies will be rebranded as Rite Aid and some Rite Aids will continue to operate as stand-alone stores. Rite Aid CEO John Standley will become CEO of the new combined company while Miller will become chairman.
Rite Aid (RAD) inched up 1% Tuesday after surging in pre-market trading.