China has become the world's largest online car-hailing market, vice transport minister Liu Xiaoming told a briefing.
"The legitimacy of internet ride-booking services are clarified" in new regulations on taxi industry reforms and regulations on car-hailing apps, Liu said.
Didi Chuxing said it was "the first time" any government had legalised online car-booking services at the national level, hailing the move as a "milestone".
Beijing's stance on the sector had been ambivalent because while the apps have won public support, they threaten old-style taxis, -- which often generates income for local authorities -- and have been met with protests by cab drivers.
More From This Section
Liu said the new rules will support the development of online car-booking platforms, adding that private cars were encouraged to provide ridesharing services to "promote the sharing economy" and "ease traffic jams in cities and reduce air pollution".
Under the rules, the provinces where ridesharing apps are registered can issue them with a licence valid nationwide.
Unlike traditional taxis, ridesharing cars are not subject to an eight-year service limit but can operate until they have accumulated 600,000 kilometres apparently addressing concerns of part-time drivers.
"Didi will make an earnest effort to comply with the new rules and adopt its corresponding standards," Didi Chuxing said in a statement, adding it will apply for the licences "soon".
They "send a clear message of support for ridesharing and the benefits that it offers riders, drivers, and cities," it said in a statement.
"Uber China is regulation-ready, and we look forward to working with policy makers around the country to put these regulations into practice."
Both firms have spent vast sums on subsidies for both drivers and passengers as they battle for market share in the country.