Yahoo Inc is in advanced talks to leave its Japanese joint venture in an effort to sort out its dysfunctional Asian partnerships and free up as much as $8 billion to fight Google and Facebook.

A deal to transfer Yahoo's 35 percent stake in Yahoo Japan to Softbank Corp, which already controls 42 percent of the unit, could come within a few weeks, people with knowledge of the discussions said.

If a deal is reached, Yahoo is likely to turn its attention to China, where it owns about 40 percent of prominent Internet company, Alibaba Group, the parent company of Alibaba.com, these people said.

It was not immediately clear what Yahoo wants to do with that stake.

Relations between Yahoo, Softbank and Alibaba have soured in recent years with Alibaba founder Jack Ma agitating to buy back Yahoo's stake in his company and Softbank founder and major shareholder Masayoshi Son openly attacking Yahoo's track record as an innovator and its approach to international markets.

Softbank also owns a stake in Alibaba.

There is a triangular relationship between the three parties. Anything that happens with Alibaba has to involve all three parties, one of the sources said.

Shares of Yahoo Japan rose 3.7 percent in Tokyo after Reuters first reported the talks on expectations Softbank would pay a premium for the stake. Softbank, Japan's No.3 mobile phone operator, closed 3.6 percent weaker on worries over how it would finance the deal, while Alibaba.com dipped 1.3 percent in Hong Kong.

Softbank, in a statement released through the Tokyo Stock Exchange, said it was not in talks with Yahoo and had no intention to buy its stake in the Japanese business.

CASH INFUSION

A deal for Yahoo's stake in the mature Japanese market could bring a cash infusion that could be viewed favorably by investors, analysts have said.

Leaving the fast-growing and massive China market, where Western internet companies have largely failed to crack the tough regulatory regime and home-grown rivals such as Baidu Inc, would be more controversial.

An Alibaba spokesman declined to comment on Yahoo's intentions in China, although last September the company said it had moved on from buying back Yahoo's stake.

As well as owning Alibaba.com, the country's largest business to business online platform, Alibaba Group owns Taobao, China's largest consumer-oriented e-commerce site, and Alipay, China's dominant e-payment service.

Both Alipay and Taobao are unlisted, making valuing the businesses difficult, a factor analysts believe has prevented Yahoo and Alibaba from agreeing a deal. Estimates of the value of Yahoo's stake in Alibaba have ranged from $4 billion to $10 billion, meaning as much as 80 percent of Yahoo's market value is tied up in its Asian assets.

The deal comes with Yahoo Chief Executive Carol Bartz under pressure to turn around the once mighty Internet company, which has lost traffic to the likes of Google and Facebook.

A much hoped-for turnaround in its Internet advertising following a splashy search tie-up with Microsoft Corp has yet to materialize and in January Yahoo reported its third consecutive quarter of declining page views on its websites.

Since 2005, Yahoo's market value has roughly halved to about $21.5 billion, while Google's has tripled to almost $200 billion.

NUMBER OF OPTIONS

A straightforward sale of Yahoo's stake in Yahoo Japan, worth around $8 billion at market prices, is unlikely for tax reasons and the parties are exploring other structures, these people said. A deal has not yet been reached and could yet fall apart.

If finalized, it means Yahoo Japan will completely be under Softbank's umbrella, said Makoto Kikuchi, chief executive officer at Myojo Asset Management Japan. Yahoo Japan will likely strengthen its Internet and cell phone content businesses so there will likely be synergy.

Son has achieved stronger growth than his two bigger mobile phone rivals in Japan through an exclusive network agreement for Apple Inc's iPhone. The outspoken technology entrepreneur fell out with the straight talking Bartz after Yahoo Japan replaced its search advertising partner with Google last year.

Tax-free options include an asset swap, where Softbank would acquire a stake in Yahoo in return for Yahoo's Yahoo Japan stake. Another option is for Yahoo to issue a so-called tracking stock, which would track the performance of the Japanese unit without conferring ownership.

Such a move, which does not require Son's approval, is seen as negotiating leverage for Yahoo, which would prefer a stock swap deal, one source said. Issuing a tracking stock would likely depress the valuation of Yahoo Japan shares because of shareholder dilution, the source said.

Over the past few weeks Yahoo executives have publicly discussed the likelihood of an exit from Japan, a market it entered in 1996 with Softbank's help. The two sides are seeking tax efficient options and working with our partners so it works out well, Yahoo Chief Financial Officer Tim Morse said at a recent investors conference.

UBS is advising Yahoo. Softbank is using boutique investment bank Raine Group, founded by two Wall Street bankers, Joseph Ravitch, a former partner at Goldman Sachs, and Jeffrey A. Sine, a former senior banker at UBS. Softbank is an investor in the Raine Group.

UBS declined to comment. Raine Group's founders were not immediately available for comment.

(Additional reporting by Alexei Oreskovic in San Francisco, Kenneth Li in New York, Melanie Lee in Shanghai and Ayai Tomisawa in Tokyo; Editing by Gary Hill and Lincoln Feast)