Yahoo has sold back around half its stake in Chinese Internet firm Alibaba for $7.6bn (£4.7bn).

Alibaba is paying Yahoo most of the money in cash on top of $800m in preferred shares and $500m related to the existing intellectual property license agreement between the two companies.

Yahoo believes it will pocket $4.3bn after taxes from the deal, of which around $3m will be returned to Yahoo shareholders, on top of the $650m already paid out over the last few months.

"The completion of the first stage of the Alibaba share repurchase represents a significant milestone for both Alibaba and Yahoo," said CEO Marissa Mayer. "This yields a substantial return for investors while retaining a meaningful amount of capital within the company to invest in future growth."

Yahoo originally bought into Alibaba with a $1bn investment in 2005. That deal included the sale of Yahoo China to Alibaba.

Yahoo still owns around 20% of Alibaba, but this deal means it has the option to sell half of that should Alibaba decide to go public. Analysts expect that to happen sooner rather than later.

As for what Yahoo will do with the cash injection, some analysts are predicting an acquisition in on the cards. Foursquare and Pinterest have been suggested as possible targets, according to the Guardian.

Mayer is relatively new at Yahoo, having joined the former web giant from rival Google in July this year.