Driving in China sucks. Getting anywhere in a city like Beijing means slogging through colossal traffic jams and chaotic, bewildering intersections. Crashes kill 500 people daily, and everyone views the rules of the road as advisory at best. “Many drivers and pedestrians think that traffic signals are just for reference,” says Jing Wang.

He’s teasing—kinda. But Wang is entirely serious when he says Beijing and Shanghai are a perfect laboratory for self-driving cars. He leads the autonomous vehicles program at Baidu (China’s version of Google), and he’s confident China will be the first country to embrace autonomy.

That’s entirely possible, but Chinese cities don’t seem like a great place to start. Self-driving cars work best in an environment of limited variables where everyone follows set rules. You’d think cities where traffic jams span 50 lanes and intersections resemble parking lots would be a horrible proving ground. So far, most of the automakers and tech firms around the world racing to develop this tech have tested it on highways or quiet suburbs, although Google recently sent its cars into Austin, Texas.

Google’s cars have racked up more than 1.5 million miles and caused just one crash since the program started in 2009, and Google expects to see customers in cars by 2020. Wang is betting that Baidu beats them. That’s not crazy, says Larry Burns, who once led R&D at General Motors and advises automakers on such things. He sees robo-cars rolling out in some parts of the US in two or three years. “Could China move faster than that? Absolutely,” he says.

Baidu launched its program three and a half years ago, and announced in December that a prototype drove 18.6 miles through Beijing. The company refuses to reveal the scope of its program, nor will it say how many miles its cars have driven or how many crashes they’ve had. Despite its relatively late start, Baidu plans to have fully autonomous cars in commercial applications by 2019 and ramp up to mass production and widespread distribution by 2021.

Self-driving cars are rated from levels zero (bag-of-flesh does everything) to four (bag-of-flesh obsolete). To tackle China’s extreme traffic, Baidu needs level 4+.

Of course, building the cars is easy once you’ve mastered the underlying technology. But programming machines to navigate public roads is hard enough when human drivers bend rules by speeding, rolling through stop signs and doing all the other things human drivers do. How is a robo-car to cope when almost everyone ignores the rules?

“It’s all about artificial intelligence” says Wang. Baidu puts deep learning and AI at the center of everything it does, an investment the company made just as it started contemplating autonomous cars, he says. The same technology that’s learning to spot malware is learning to spot pedestrians. The US National Highway Traffic Safety Administration rates vehicle autonomy from level zero (bag-of-flesh does everything) to level four (bag-of-flesh is obsolete). Given the challenge of China’s traffic, Baidu coined a new term for its system: Level 4+.

Of course, handling China’s roads and being welcome on China’s roads are two different things. Wang is confident that the country is the right place to debut autonomous tech. He cites three factors in its favor: a population prone to embracing new tech, a vast auto industry, and a national appetite for big, bold projects.

Far fewer people own cars in China than in the US, and high adoption rates for new technologies indicate the Chinese would embrace cars without drivers, Wang says. A 2015 World Economic Forum study backs this up. It found that 75 percent of Chinese respondents are inclined to ride in an autonomous taxi, compared to 52 percent of Americans.

As for the auto industry, Baidu doesn’t plan on building cars. Wang predicts the country’s 40 automakers, many of them small and struggling, will embrace autonomy to remain relevant. They provide the cars, Baidu provides the brains. “We don’t have to reinvent the wheel,” he says.

Although the government hasn’t been as aggressive as Baidu would like in encouraging autonomous vehicles, one Chinese city is unambiguously supportive. Within a decade, Wu Hu, about 200 miles west of Shanghai, aims to become the first city in the world to ban human drivers and go fully autonomous. Baidu hopes to use the city to showcase the increased safety and decreased congestion and emissions that come with letting the AI drive.

A large-scale experiment of that sort is far more likely in China than the US or EU because the country “doesn’t necessarily have to have the debate to reach a conclusion,” says Burns. He sees another reason to bet on China: the country desperately needs autonomous cars to suit an expanding middle class with an appetite for autos. “They’re going to need to leapfrog the transitional roadway transportation system,” he says. China’s cities simply cannot handle more conventional cars and the congestion and emissions they bring. Embracing efficient (and likely electric) self-driving cars could be the answer.

But even if autonomous cars can’t fix all of China’s mobility woes, a 10-day traffic jam isn’t as hellish if you don’t have to hold the wheel the whole time.