Chinese search giant – Baidu – and the Bavarians from BMW are joining powers to compete with Silicon Valley’s best and brightest. The two companies are working on a joint project to produce a self-driving car for the Chinese market. Baidu reports that it just completed the first successful tests of its driverless car through the streets of Beijing. Using a revamped BMW 3 Series, Baidu’s road tests included a complex set of driving instructions while the vehicle had to respond to its surroundings.

“Fully autonomous driving under mixed road conditions is universally challenging, with complexity further heightened by Beijing’s road conditions and unpredictable driver behavior,” says Wang Jing, the SVP of Baidu and General Manager of Baidu’s Autonomous Driving Business Unit.

Baidu’s chief scientist Andrew Ng also describes a situation where the autonomous car might have saved lives. “I was glad our driver hit the brakes, but then I found out it was the car that did it automatically,” Ng said. “If I had been driving, we would have hit the car in front.”

The 3 Series comes equipped with Baidu’s AutoBrain software which makes use of highly automated driving maps, positioning, detection, and smart decision making and control. The test occurred over a 18.6 miles route and consisted of the self-driving car traversing across side streets, making left and right turns, switching lanes, and overtaking other regular cars, even merging onto and off traffic along highways as fast as 62mph.

The car is said to be in development since 2013, but no launch date has been communicated.

BMW has been testing self-driving cars since 2011 when a 330i was put to test on a closed circuit. The autonomous driving project continued in 2014 with a 6 Series Gran Coupe performing self-drifts, and earlier this year, a self-driving BMW i3.