Even though ride-hailing services like Uber and Didi Chuxing have been operating in China for years, their existence has always been a bit of a legal gray area in the country. But a new law has been passed that will formally allow these firms to offer their services starting this November.

The companies are requried to follow some rules if they want to keep their legal status; drivers must have three years' experience, no criminal record, and be licensed by local taxi regulators.

The new regulations also cover the drivers' vehicles; they must have fewer than 370,000 miles on the odometer, feature alarms and GPS tracking, and have no more than seven seats. Additionally, any user information and data that is collected must be stored within China for at least two years.

Bloomberg revealed an early version of the draft last year that would have banned the use of private cars for ride-hailing companies, but this requirement, along with some other stricter rules, were dropped for the final version.

Uber said in a statement that it already operates in 60 Chinese cities and plans to expand to 30 more over the coming months. Precisely how the new law is enforced will be up to local cities and provinces.

"This is a welcome step in a country that has consistently shown itself to be forward-thinking when it comes to innovation," wrote Zhen Liu, Uber's senior vice president for corporate strategy for its Chinese apparatus. "Uber China is regulation-ready, and we look forward to working with policy makers around the country to put these regulations into practice," he added in a statement.

Uber rival Didi Chuxing, which controls over four-fifths of the ride-hailing market in the country, also praised the move. The company told TechCrunch it "welcomes the government's endorsement and encouragement of the industry and China's emerging sharing economy."