Shares of Rite Aid were more than 12 percent lower Tuesday at $2.40 a share, while Walgreens stock closed down about 1.7 percent.
Drugstore chain giant Walgreens said it has clearance from the Federal Trade Commission to buy 1,932 stores from Rite Aid for $4.38 billion. That's 254 fewer stores than it had intended in June.
The move to reduce the number of stores was seen a way to resolve antitrust concerns after repeated failed attempts.
Walgreens said it also intends to buy Rite Aid's three distribution centers located in Dayville, Connecticut; Philadelphia, Pennsylvania; and Spartanburg, South Carolina. The transition of the distribution centers will not begin for at least 12 months.
The announcement comes three months after Walgreens called off its near two-year deal to buy Rite Aid. Walgreens struggled to win antitrust approval and instead said it would acquire nearly half of the smaller rival's stores.
The deal is expected to widen Walgreens' footprint in the U.S. and could help it negotiate for lower drug costs.
The store purchases are expected to begin in October with completion anticipated in spring 2018, Walgreens said.
Ajay Jain, senior research analyst at Pivotal Research Group, told CNBC he was not surprised by the number of stores that were sacrificed to salvage the deal.
Following the June transaction between the companies, Jain said he expected the number of stores would need to be tweaked further due to overlap issues.
"With this process taking close to two years to come to a conclusion, we think the final outcome and the structure of the transaction were well anticipated," said Jain, who has a hold rating on Walgreens.
"However, with each recent iteration of the transaction, the economics appear to be shifting more and more in Walgreens' favor," he added.
The deal should not have a significant impact on Walgreens' adjusted earnings for the fiscal year ending Aug. 31, 2018, the company added, and it expects annual synergies from the new transaction of more than $300 million.
"We are confident in the path ahead and look forward to working together to shape the future of health care and deliver on the full potential these stores bring to our network," Walgreens Executive Vice Chairman and CEO Stefano Pessina said in a press release.