Mr. Xi viewed the South African-born entrepreneur as a technology utopian with no political allegiance to any country, according to officials involved in policy-making, and saw his Tesla Inc. as a spearhead that could make China a power in new-energy cars.
Mr. Xi rewrote the rulebook to allow foreign companies sole ownership of auto ventures so Mr. Musk would open an electric-vehicle factory in Shanghai. Authorities showered him with cheap land, low-interest loans and tax incentives, expecting in return that Tesla would groom local suppliers and bolster lagging Chinese electric-vehicle players, say people with knowledge of the talks between Beijing and the company.
Today Tesla likely makes more than half its vehicles in China, suggest calculations based on the company's third-quarter production and delivery figures and China Passenger Car Association data. Chinese sales helped propel Tesla to its first full year of profitability in 2020 and provided roughly a fourth of Tesla's revenue in the first nine months of 2021. Mr. Musk, meanwhile, has cemented his place as the world's wealthiest person.
But Tesla is facing an increasingly difficult business environment in China now. It has drawn wrath from domestic rivals over what they see as preferential treatment, suffers criticism of its vehicle quality from drivers and Chinese officials, and has been caught up in the government's sweeping crackdown on big tech.
China is pressing foreign companies to meet an ever-more-stringent policy on data security. Tesla now must retain inside the country all digital records gathered from local customers, and it must ask authorities for approval before updating certain software on cars in China.
Mr. Musk's response to the pressure has been to become a high-profile cheerleader of China's ruling Communist Party, in sharp contrast to his renegade persona in the U.S., where he has clashed with the Securities and Exchange Commission and mocked President Biden in tweets, once calling him a labor union sock puppet.