Walgreens Boots Alliance has ended its bid to takeover Rite Aid Corp, and will instead buy a smaller part of its rival’s drugstore chain, as the original deal was blocked due to antitrust problems in the U.S.

The new deal will end a saga that has dragged on over 18 months as the two companies have struggled to receive approval from federal regulators.

The two said on Thursday they were ending the takeover of $7.37 billion and Walgreens would instead pay $5.18 billion for the purchase of 2,186 Rite Aid stores, which will leave Rite Aid as just a region drugstore chain.

Walgreens CEO Stefano Pessina called the new deal much simpler and due to being an asset deal it is far less controversial.

The new deal just might be the way the United States Federal Trade Commission is finally satisfied. The FTC was reviewing the original bid and had reportedly been skeptical that there would be sufficient competition across the drugstore market even though a plan had been made to sell as many as 1,200 of Rite Aid stores to small drugstore chain Fred’s.

Fred’s will not receive the 1,200 divested stores that were part of the first deal and its stock dropped by 25% down to just $9.25 on the news.

CEO of Fred’s Michael Bloom called the outcome disappointing. However, he said the end of the transaction did not have any impact on the transformation strategy of Fred’s and its ability to execute the same.

Shares of Rite Aid plunged on Thursday following the news. The drugstore chain’s stock fell 23% in early trading in New York, while Walgreens stock was up 4.9%.

Through a prepared statement, the FTC said that it would review the new agreement and would end its review of the first one due to both companies withdrawing their filings.

The FTC also stated that it investigated many divestiture proposals that the two companies had submitted.

This marks the second time the plan by Walgreens had been altered to acquire Rite Aid locations. The first deal announced during October of 2015 was valued at $9.4 billion.

A second deal that made changes to the first was in January that lowered the price to between $6.83 and $7.37 billion, depending upon the number of stores that ultimately changed hands.

Under the current deal, Walgreens is not purchasing Rite Aid, but just buying stores and other assets the company has. Rite Aid will be given a $325 million termination fee along with the purchase price.

Get Analysts' Upgrades and Downgrades Daily - Enter your email address below to receive a concise daily summary of analysts' upgrades, downgrades and new coverage with MarketBeat.com's FREE daily email newsletter.