Following news that the Chinese government had partly outlawed electric vehicles on national security concerns, Tesla CEO Elon Musk said his company would not spy on anybody.

Military and state personnel, as well as certain state departments and industries, are reportedly no longer permitted to drive Tesla vehicles to certain compounds. Musk dismissed the concerns during a speech at the China Development Forum, CNN reported Monday.

"If Tesla used cars to spy in China or anywhere, we [would] get shut down," Musk told guests, emphasizing the company would not use its vehicle's technologies to compromise Chinese secrets. 

According to initial reports on China's Tesla restrictions, the country is concerned that the car's cameras and sensor capability would capture photos as well as their location. The government also objects to the cars' ability to monitor data on where they are driven and how drivers use them.

The Chinese military Tesla ban was supposedly issued "a couple of weeks ago," an anonymous source told The South China Morning Post after Chinese leaders were "very concerned" about the vehicles. Just hours before Musk's speech Saturday, a screenshot of an order prohibiting Tesla models from entering a military accommodation complex went viral on Chinese social media.

There has long been concern over large American businesses operating in China and vice versa. Relations between China and the U.S., the world's two largest economies, are at their most troubled in years.

Earlier this week, officials from both countries exchanged angry words during the first high-level talks between the Chinese government and President Joe Biden's administration.

So far, there is no indication that China's decision to limit Tesla would damage the automaker's local success. However, as it ramped up Model 3 production at its new Shanghai-area plant, the country helped Tesla get really close to Musk's 2020 target of producing 500,000 EVs in a single year. The Model Y is now also manufactured in China.

In 2018, Tesla received clearance for its Shanghai facility, making it the first global automaker to run a wholly-owned plant in China.