Uber China has agreed to sell its business to rival Didi Chuxing.
The cab service app’s China business will retain its separate branding, and Uber’s global business will receive a 5.9% stake in the combined company, Didi Chuxing said.
Uber China launched in 2014 but so far has failed to make any profit.
The two companies have been fierce competitors for years, but Didi Chuxing dominates the market.
The company is backed by Chinese internet giants Tencent and Alibaba, and has also invested in Uber’s rival US cab service Lyft.
Uber has been struggling to break into the Chinese market despite having Chinese search engine Baidu as an investor.
In February, Uber admitted it was losing more than $1 billion a year in China, spending huge sums to subsidize discounted fares.
The fierce rivalry had led Uber and Didi to heavily subsidize their journeys. The merger is likely to see fewer such subsidies.
The deal with Didi Chuxing comes just days after China agreed to provide a legal framework for taxi-ordering apps.
Both Uber and Didi have welcomed the decision, having previously operated in a legal grey area in China.
While the apps are widely popular, they have undermined business for normal taxis and have been met with protests by cab drivers.
The new rules will take effect on November 1, 2016, and will, among other things, forbid such platforms to operate below cost.