Drugstore giant Walgreen Boots Alliance dropped its $7.37bn takeover bid to buy US-based rival Rite Aid on Thursday.

Instead Walgreens will pay $5.18bn to buy 2,186 Rite Aid stores located in the northeast, mid-Atlantic and southeast as well as some distribution centres.

Walgreens is expected to complete its acquisition of Rite Aid stores and related assets in the next six months.

“This deal is much simpler,” Walgreens chief executive Stefano Pessina said on a conference call. “It is an asset deal so it is less controversial.”

“We believe this new transaction addresses competitive concerns previously raised with respect to the prior transaction,” Pessina added in a statement. “This new transaction extends our growth strategy and offers additional operational and financial benefits.”

Rite Aid shares were down more than 27 percent to $2.84, while Walgreens shares rose 2.8 percent to $79.26 in midday trading immediately after the announcement.

The abandoned buyout ends nearly two years of negotiations since the plans were first announced in October 2015.

The US Federal Trade Commission (FTC) had expressed competition concerns about the original takeover proposal.

Walgreens will  pay Rite Aid a $325m termination fee for scrapping the original agreement.

“It’s a clear positive for Walgreens,” Jeff Jonas, a portfolio manager at Gabelli & Co. which holds less than 1 percent of Rite Aid and Walgreens shares told Bloomberg. “Rite Aid was always going to be a big turnaround story, now it’s just easier to do it with a smaller number of stores, it frees up the capital for the buyback.”

Alliance Boots merged with Walgreens in December 2014, and the combined company currently boasts over 13,200 stores in 11 countries.

Rite Aid, headquartered in Pennsylvania, has a total of just 4,621 stores across the US.