Tesla is recalling about 285,000 electric vehicles in China because the cruise-control function can be activated accidentally and cause cars to accelerate suddenly, creating a safety hazard, Chinese authorities said Saturday. In a message to customers on the Chinese social media platform Weibo, Tesla said “there are potential safety hazards in extreme cases.” China’s market regulator said the recall covers 211,256 Model 3 sedans and 38,599 Model Y compact crossover utility vehicles that were built in China and 35,665 Model 3s that were imported. The cars were produced between December 2019 and this month. The regulator said Tesla plans to upgrade cruise-control software on the vehicles remotely, which would save owners the chore of taking their car to a company store. It said Tesla will contact owners whose vehicles cannot be fixed remotely. China’s State Administration for Market Regulation said that under certain conditions drivers could accidentally activate cruise control. If the car is travelling slower than the cruise control setting, the car will accelerate “and in extreme cases,” could cause a crash. The regulator said Tesla’s Chinese subsidiaries contacted it “a few days ago” to request a recall. Tesla, based in Palo Alto, California, did not respond to messages seeking comment. The company has faced previous challenges in China, including accusations of poor treatment of customers. In April, a customer protested at a car show that faulty brakes on her family’s Tesla caused a crash that sent her parents to the hospital. After initially blaming the driver, Tesla issued a public apology to the unhappy customer and vowed to learn from the incident.