The recall comes two years after US authorities began investigating the safety of the cars following a series of accidents involving the use of the semi-automated Autopilot system. Some of the accidents were fatal.

The recall affects nearly all vehicles Tesla has sold in the United States since the Autopilot system was activated in late 2015. As a corrective measure, the firm will roll out the update to some Model S, X, 3 and Y vehicles, the authority said.

“Automated technologies hold great promise for improving safety, but only if deployed responsibly,” NHTSA said. “Today’s action is an example of improving automated systems with safety as a priority,” he added.

For years, car safety advocates have been calling for stricter regulation of the driver monitoring system, which primarily detects whether the driver has his hands on the steering wheel. Autopilot can automatically steer, accelerate and brake within a lane, but it’s a driver assistance system and, despite its name, it can’t drive itself.

Independent tests have found that the monitoring system can be easily fooled, so much so that drivers have been caught driving drunk or even sitting in the back seat.