US telecoms giant Verizon is selling its media assets, which include the two companies, to a US private equity firm in a deal worth $5bn (£3.6bn).
Verizon bought Yahoo in 2017 and AOL in 2015 for a combined $9bn.
Yahoo and AOL were once trailblazers, but were subsequently overshadowed by firms like Google and Facebook.
Under the sale of the media assets to Apollo Global Management, Verizon will retain a 10% stake in the division.
Verizon bought the two brands in the hope of a quick entry into the digital advertising market, believing they still had enough resonance with consumers.
Yahoo and AOL were pioneers in offering a wide range of free and informative web services to consumers, long before Google came into existence. By providing free web mail and chat messenger services, the two firms had a cornerstone for online advertising on the market, as most internet users in the early 2000s were accessing their websites and software on a daily basis.
Yahoo also provided everything from the news, weather reports, sports results and movie release dates; to message boards, its own version of eBay - Yahoo! Auctions - and real-time markets data.
But over the last decade, Yahoo and AOL have faced an uphill struggle against more powerful rivals like Google, Bing, Facebook, Twitter, ESPN, Fandango and Weather.com, due to a saturated internet market.
Verizon also made a mistake in failing to acquire Yahoo's equity stake in Chinese e-commerce behemoth Alibaba, as well as Yahoo Japan, where Yahoo! Auctions is still thriving.