Verizon is exiting the media business, announcing Monday that it’s selling the unit for $5 billion to private equity firm Apollo Global Management.

The sale includes AOL and Yahoo, which Verizon bought for a combined $9 billion in recent years. Verizon will retain a 10% stake in the spin off and the Verizon Media Group name will be changed to just Yahoo.

Verizon once had great plans to becoming a dominant player in the online media and ad business. The telephone company bought AOL for $4.4 billion in 2015 and further bolstered its portfolio with its Yahoo purchase at a similar price in 2017. The unit was briefly named Oath, but Verzion admitted that its plans to take on Google, Alphabet and Facebook was essentially a waste when it took a $4.6 billion writedown on Oath in 2018.

In a press release, Verizon said that sale allows the company to “aggressively pursue growth areas and stands to benefit its employees, advertisers, publishing partners and nearly 900 million monthly active users worldwide.”

“With Apollo’s sector expertise and strategic insight, Yahoo will be well positioned to capitalize on market opportunities, media and transaction experience and continue to grow our full stack digital advertising platform,” said Verizon Media CEO Guru Gowrappan in the release. Gowrappan will continue to lead the new company.

The transaction is expected to close in the second half of 2021. Verizon’s shares slightly rose in premarket trading.