A Tesla Model 3 vehicle. |PC: Allison Dinner/Getty Images

Tesla is recalling more than two million cars after the US regulator found its driver assistance system, Autopilot, was partly defective.

The recall applies to almost every Tesla sold in the US since the Autopilot feature was launched in 2015. It follows a two-year investigation into crashes that occurred when the tech was in use.

Tesla, owned by billionaire Elon Musk, said it would send a software update “over the air” to fix the issue meaning the update happens automatically and does not require a visit to a dealership or garage, but is still referred to by the US regulator as a recall.

The US National Highway Traffic Safety Administration (NHTSA) said the recall was due to an issue with Autopilot’s driver monitoring system, which detects whether the driver is paying attention.

As part of what it has called an “extensive” two year investigation, NHTSA reviewed 956 crashes where Autopilot was initially alleged to have been in use.

That investigation has culminated in this recall, and with Tesla conceding that the system’s controls “may not be sufficient to prevent driver misuse”.

“Automated technology holds great promise for improving safety but only when it is deployed responsibly”, the NHTSA wrote, adding it would continue to monitor the software once it was updated.