Long-term care pharmacy PharMerica Corporation will be acquired by global investment firm KKR in a $1.4 billion deal that includes Walgreens as a minority investor, the companies announced Wednesday.

A “newly formed company” controlled by KKR, with Walgreen Boots Alliance Inc. on board as an investor, will pay $909.4 million to acquire PharMerica, and assume $490 million of the pharmacy provider’s debt. The transaction is expected to be completed by early 2018.

The move makes sense for KKR, Edward Buthusiem, JD, a managing director at Berkeley Research Group explained to McKnight’s

“As a financial buyer in a going-private transaction, the KKR/Walgreens venture will seek to achieve synergistic value by combining Walgreen’s retail and mail order operations with Pharmerica’s nursing home and clinic-based pharmacy operations and using this purchasing power as potential leverage to negotiate better pricing at the wholesaler level,” Buthusiem said. “Similarly, the combination could also enable the new venture to negotiate more favorable arrangements with managed care entities.”

Gregory S. Weishar, PharMerica CEO, said in a statement the acquisition “will deliver immediate and compelling value to all PharMerica shareholders, as well as substantial benefits to our clients and employees.”

“With the support of KKR and a strategic partner in Walgreens Boots Alliance, PharMerica will have additional resources and expertise to advance and grow the business,” Weishar said.

Talk of a takeover deal involving PharMerica and Walgreens has been swirling since CVS announced its purchase of Omnicare, the nation’s largest long-term care pharmacy provider, in 2015. Buthusiem noted that the transaction “does enable Walgreens to meet the competition from the CVS/Omnicare combination,” and that “one would expect this competition to result in more competitive pricing in the managed care network.”