Illustration by Mark Speakman

Retail pharmacy giant CVS announced Thursday it will acquire Omnicare, marking the third major recent consolidation among pharmacies and allied companies providing specialty services and pharmacy benefit programs.

CVS will purchase Omnicare for $10.4 billion and assume another $2.3 billion in Omnicare debt, according to published sources. Omnicare is far and away the biggest provider of pharmaceutical services to nursing homes and other long-term care providers in the U.S.

CVS is making the acquisition to gain entry into the booming long-term care specialty markets of nursing homes and assisted living facilities, the Wall Street Journal reported Thursday. More than 25% of Omnicare’s revenue comes from marketing, distributing and securing reimbursement for high-price drugs typically aimed a small patient populations, the newspaper reported.

Omnicare serves 160 locations in assisted living and long-term care facilities in 47 states. “The acquisition of Omnicare significantly expands our business, providing CVS Health access into a new pharmacy dispensing channel,” CVS Health CEO Larry Merlo said Thursday.

Share prices of CVS and Omnicare both rose after Thursday’s announcement. Omnicare’s sales rose 5.6% to $1.7 billion during the first quarter of this year. The deal is expected to formally close near the end of 2015.

The long-term care industry continues to expand, with the Congressional Budget Office estimating 12% growth in the 65 and older population by 2050.

CVS competitor Rite Aid paid about $2 billion for Envision Pharmaceutical Services (EnvisionRx) in February. One month later, UnitedHealth Group bought Catamaran, one of the largest U.S. pharmacy benefit managers, for $12.8 billion, the Wall Street Journal reported.