NEW YORK (AP) – Walgreens and Rite Aid have finally devised a combination of the nation’s largest and third-largest drugstore chains that will get past antitrust regulators.

The companies said Tuesday that they have Federal Trade Commission clearance for a slimmer version of a store-purchase agreement announced in June. Walgreens will now spend $4.38 billion on 1,932 stores, three distribution centers and inventory.

The drugstore chains had said earlier this summer that Walgreens planned to spend about $5.18 billion on 2,186 stores.

That deal marked a step down from Walgreens’ initial plan to take over Camp Hill, Pennsylvania-based Rite Aid Corp. for $9.4 billion. That deal spent a couple of years in regulatory review before the companies abandoned it.

Deerfield, Illinois-based Walgreens Boots Alliance Inc. says the latest deal should be completed by spring.

(© Copyright 2017 The Associated Press. All Rights Reserved. This material may not be published, broadcast, rewritten or redistributed.)