Ride-hailing firm Didi Chuxing said will buy Uber's China operations, in a deal that will end competition between the two companies.

The deal is valued at $35 billion, according to an unconfirmed source. Didi confirmed the agreement on its official microblog, but gave no valuation. Uber Technologies will receive a 5.89 percent stake in Didi.

Uber will continue to operate independently, the Didi posting said. "Cooperating with Uber will give the entire mobile travel industry a healthier order and a period of a higher level of development," it said.

Uber is operating in more than 60 cities in China and serves more than 40 million rides a week.

Didi said in its posting it will look to expand its international business and enter markets like Hong Kong, Taiwan, Macau, Japan, South Korea, Europe and Russia.

Didi was created last year from a merger of two firms backed respectively by e-commerce giant Alibaba Group and social network firm Tencent. The Chinese company has has invested $100 million in Lyft, Uber's main rival in the United States.