Tesla has cleared some key regulatory hurdles that have long hindered it from rolling out its self-driving software in China, paving the way for a favorable result from Elon Musk's surprise visit to the U.S. automaker's second-largest market.

Tesla CEO Musk arrived in the Chinese capital on Sunday, where he was expected to discuss the rollout of Full Self-Driving (FSD) software and permission to transfer driving data overseas, according to a person with knowledge of the matter.

The billionaire's whirlwind visit, during which he met with Chinese Premier Li Qiang, came just over a week after he scrapped a planned trip to India to meet with Prime Minister Narendra Modi, citing "very heavy Tesla obligations."