NEW YORK — Walgreens confirmed Tuesday that it will buy rival pharmacy chain Rite Aid for about $9.41 billion in cash.

The Wall Street Journal first reported news of the deal.

Walgreens says it will pay $9 per share for Camp Hill, Pennsylvania-based Rite Aid Corp. That’s a premium of 48 percent to the closing price of Rite Aid Monday. The deal is worth $17.2 billion when debt is included, the companies said.

Walgreens Boots Alliance Inc., based in Deerfield, Illinois, is the largest U.S. drugstore chain, based on store counts. Rite Aid is the third largest.

The deal expected to close in the second half of next year.

This is a developing story; check back for updates.