Image caption The agreement paves the way for Alibaba to consider a share sale

US internet company Yahoo said it has reached a deal to sell part of its stake in China's biggest internet company Alibaba Group.

Alibaba will buy back half the 40% stake owned by Yahoo, following years of negotiations.

The deal will raise about $7.1bn (£4.5bn) for Yahoo, which has been losing ground to rival Google and Facebook in online advertising.

The agreement also allows Alibaba to consider an initial public offering.

Shareholders

Both companies revealed in a statement that Alibaba will pay Yahoo $6.3bn in cash and up to $800m in Alibaba preferred stock.

For Yahoo, the deal gives it the ability to pay dividends, make acquisitions, or buy back its own shares, something its stockholders have been asking for.

Analysis Alibaba gets a roadmap to independence. Yahoo gets to translate a fortuitously profitable investment into cash for its shareholders. Importantly, Yahoo has the right to hold onto 10% of Alibaba shares until after a possible future listing. The fine print seems to point to an initial public offering in 2015, although Alibaba is not committed to any specific time frame. A listing would be one of the biggest technology offerings in the world. That is because, among its many subsidiary units, it owns Taobao.com, where consumers sell to other consumers. It has 370 million registered users, more than the entire population of the US. Some reports say the value of goods sold on Taobao even exceeded eBay's back in 2010. In addition to Taobao.com, Alibaba also owns Tmall.com, where 70,000 Chinese and international brands sell their products online.

"We look forward to delivering the proceeds of the near-term transaction to our shareholders," said Timothy R Morse, chief financial officer at Yahoo.

Some analysts have said that most of Yahoo's value is based on its Asian assets, and selling them will allow its core US operations to be valued by investors.

'New chapter'

The agreement also allows the Chinese group to buy more of Yahoo's remaining 20% stake, if Alibaba pushes ahead with a sale of its own shares on the stockmarkets, a move that many observers expect.

The deal is welcome news for Alibaba which has long been looking to buy back the part of its company owned by Yahoo. However, negotiations have suffered many setbacks.

"This transaction opens a new chapter in our relationship with Yahoo," said Jack Ma, chief executive officer of Alibaba Group, which runs the popular Chinese online market place Taobao.

He also said both companies would continue to work together, with Yahoo's global audience being an attractive opportunity for Alibaba, as it seeks growth outside China.