Uber Technologies Inc. is selling its China operations to fierce rival Didi Chuxing, ending an expensive price war and freeing it up to focus on other markets and possibly an initial public offering.

QuickTake The Sharing Economy

The truce brings to an end a bruising battle between the two companies for leadership in Chinas fast-growing ride-hailing market. Uber has already lost $2 billion in China in two years there, people familiar with the matter have said, prompting investors to pressure the company to cut a deal. As part of the arrangement, Didi will invest $1 billion in Ubers global company, people familiar with the matter said.

Uber has said that its profitable in the U.S. and Canada, but losses in developing markets have undercut that hard-fought progress. The huge losses in China have been one of the main sticking points holding up Ubers potential IPO, according to people familiar with the matter.

The biggest existential threat to Uber over the last two months was that in China they were losing capital in a way that potentially threatened the rest of their worldwide operations, said Arun Sundararajan, a New York University professor. The fact is that in the short term it may seen as a loss, but in the long run its a good move. Now they can focus on the rest of the world.

With China settled, Uber can turn to other countries where its fighting for market share, such as Grab in Southeast Asia, Ola in India and Lyft Inc. in the U.S.

Didi is buying Ubers brand, business and data in the country, the Chinese company said in a statement. Uber Technologies and Uber Chinas other shareholders, including search giant Baidu Inc., will receive a 20 percent economic stake in the combined company. Didi founder Cheng Wei and Uber Chief Executive Officer Travis Kalanick will join each others boards.

Didi Chuxing and Uber have learned a great deal from each other over the past two years, said Cheng, who is also CEO, in the statement. This agreement with Uber will set the mobile transportation industry on a healthier, more sustainable path of growth at a higher level.

Didis valuation after the deal will be $35 billion, said people familiar with the matter, asking not to be named because the details arent public. Uber was last valued at almost $68 billion and the arrangement has removed the big roadblock for an Uber IPO, Sundararajan said. Losing money in China wouldve given many pre-IPO investor pause.

For a QuickTake explainer on the growth of the sharing economy, click here

Last year, Chinas ride-hailing leaders Didi and Kuaidi joined forces, creating a homegrown juggernaut to fight off Uber. The merged company Didi Chuxing brought together backers Alibaba Group Holding Ltd. and Tencent Holdings Ltd., the countrys most valuable internet businesses. Apple Inc. joined in this year with a $1 billion investment in Didi, in a round that valued the company at about $28 billion. The Chinese government passed a new rule last week that legalized ride-hailing services, paving the way for further expansion of these businesses.

Ubers investors had been clamoring for the company to sell off its China assets and focus on more promising opportunities.

As an entrepreneur, Ive learned that being successful is about listening to your head as well as following your heart, Kalanick wrote in a blog post obtained by Bloomberg before publication. I have no doubt that Uber China and Didi Chuxing will be stronger together.

The deal is subject to government approval. While the combination of the top two players in a market would often raise regulatory scrutiny, officials will have to determine the range of competition. “The ministry of commerce has to define the size of the market and see if the car-hailing business Didi and Uber are offering can be replaced by similar services, said Deng Zhisong, senior partner at Beijing-based law firm Dentons. If you count taxi services and public transportation, the car-hailing sector will not have a market share that significant.

The purchase of Ubers China business may complicate Didis alliance with other ride-hailing startups around the world. Didi had agreed to work with Lyft, Ola and Grab to create a global force to take on Uber. Grab CEO Anthony Tan said in a statement on Monday that the impending deal is a victory for Didi and underscores how the ride-hailing business favors domestic players.

In China, Uber ventured where few U.S. technology companies have succeeded. In 2005, Yahoo! Inc. made a similar deal, selling its businesses in China to Alibaba, along with a $1 billion investment — one of the Silicon Valley companys best bets.

“China is such a tough market, in terms of regulation, competition and culture; they faced challenges on so many fronts,” said Li Yujie, an analyst at RHB Research Institute Sdn in Hong Kong. “Cooperating with rather than fighting Didi might not be such a bad idea.”

For more on ride-hailing socialism in China, click here.

While Uber will walk away from operations in China, it is taking a significant stake in the largest player there. By shedding its massive losses in China, the move could help Uber clear the path for an eventual initial public offering.

Uber and Didi Chuxing are investing billions of dollars in China, and both companies have yet to turn a profit there, Kalanick wrote in the blog post. Getting to profitability is the only way to build a sustainable business that can best serve Chinese riders, drivers and cities over the long term.

Read more: www.bloomberg.com